Using the SDK
- Start by downloading the latest Y8Account Unity Package.
- Open Unity3d > Assets > Import package > Custom Package > Y8Account-Unity3d_V3_1_0.unitypackage.
- Initialize the SDK like so
Idnet.I.Initialize("app-id", false);replacing with your app-id.
It is recommened to always download the Latest version of the SDK for each game. New versions have bug fixes, improvements, and new features.
- Initialize Y8 Account in the first scene of your game, in the
Awake()method. Do this so any script can access the SDK.
- Inside Unity, find the sample scene
IdnetSampleScene.unitypackageand sample script
IdnetSample.csand copy the methods in the sample script as needed.
- For WebGL, set
Enable Exceptionsin BuildSettings > PlayerSettings > PublishingSettings to
Explicitly Thrown Exceptions Only.
- Use a method given in this script
IdnetSample.csanywhere in any scene/script (as Idnet.cs is a Singleton class).
- Before using PostScore and Leaderboard api, make sure to create a table name as explained on Table Setup page.
- IMPORTANT - Inside the unity editor, the login details will be cached. Caching is used to prevent the need to login each time a game is opened. To clear this cache, Hold
Shift + Pwhile in “Editor Play Mode” and then ‘Logout’ from the gui window.
- Having trouble? See the Frequently asked Questions column.
A working example of the sample scene can be found here.