Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
Tags

Hey ratuspro,

There are 2 approaches for using custom interfaces with SUGAR. 

1. Edit the default interfaces to match your game style/needs

This is the simpler approach, locate the prefabs in SUGAR/Example/Prefabs and make changes as required. 

These example prefabs are controlled by the SUGAR Prefab in scene and can be displayed easily using the SUGARManager. If you want to replace the interface with your own prefab, you will need to add the Interface Component (eg. AccountInterface), which can be found at SUGAR/Example/Scripts, these classes extend their base interfaces

2. Create custom interfaces

This process requires understanding of the SUGAR Client API, Set up your own panel as you would normally for your game, and instead of using the interfaces and unity client classes, you will now need to integrate using SUGARManager.Client to make requests to SUGAR. 

For example, to log in, you would use SUGARManager.Client.Session.Login(gameId, accountRequest);  - See here

To display the panel in game, you will still need to use the SUGARManager to control UI, as this will order your UI correctly to make sure that the current UI is the topmost. To do this, add the prefab to the "Custom Interface List" in the SUGAR Prefab, making sure to give it a unique name. For example, creating a custom interface called "TestPanel" could be activated using SUGARManager.Unity.EnableObject(SUGARManager.Unity.CustomInterfaces["TestPanel"]);

I Hope this helps to clear things up!

Thanks