How to update the SDK?

To update the sdk, delete the Idnet folder from your project and import the Latest version. APIs that are already implemented, will continue to work.

How do I know if a user is logged in?

if (Idnet.User.LoggedIn())
{
    Debug.Log("User logged in to IDnet: " + "Nickname " + Idnet.User.Current.Nickname);
}
else
{
    Debug.Log("Not logged-in to IDnet");
}

How to make a custom achievements menu

The CustomAchievementExample.cs script has been added in the sdk. That file will give you list of locked and unlocked achievement names and descriptions.

How to close the Y8 Account menu by code?

Idnet.I.CloseGui();

How do I sitelock my game to Y8’s network?

You can use the Sponsor Api to check if your game is running on the Y8 network.

How to setup logo buttons for Y8 sponsorships?

Branding Setup Using this Drag and Drop setup,everything will be handled by unity-sdk with no code required from your side,just drag & drop the logos in the needed scenes & position them at appropriate places on screen.

How to check if a game is hosted on the Y8 network?

If you are using the Drag and Drop Setup, the More Games button will automatically be hidden outside of Y8. It is handled internally through the sdk.

If you are not using the Drag and Drop Setup, use the Sponsor Api.

What if i am using old/legacy gui OnGUI for my game & Y8Account Login/Register boxes always show below my game UI? Any Workaround?

If you are using legacy GUI system i.e OnGUI(), follow the following workarounds:

OnGUI() workaround 1:

In newest version of unity sdk, we use Unity new UI system(Canvas), so if you are using Legacy Gui i.e OnGUI() in your project, you might see OnGUI() buttons overlaying over Y8Account Login/Register boxes.

So to overcome this, disable the OnGUI buttons coming below the y8account gui boxes.

Idnet.I.IsShowingGui(); : Rely on this bool’s true value to know if any of the Y8Account boxes are opened.

// Example
void OnGUI()
{
 // hide the OnGUI buttons when Y8Account boxes are visible.
 if(!Idnet.I.IsShowingGui())
 {
  // only disable the buttons coming below the y8account gui boxes, keeping others enabled.
  if (GUI.Button(new Rect(10, 70, 50, 30), "Button below Y8Account boxes"))
  {
    Debug.Log("Button clicked");
  }
 }
}

OnGUI() workaround 2: Using Gui boxes close button callback.

When Y8Account gui windows are opened, Disable the buttons coming below and Re-Enable them when these gui boxes are closed.

i.e Use Y8Account close button callbacks to Re-Enable your buttons.

Close button callback:

Idnet.I.Login(loginRegisterException => {
 if (Idnet.User.LoggedIn())
 {
    // Callback: Login succesfull.
    Debug.Log("User logged in: " + "Nickname " + Idnet.User.Current.Nickname);
 }
 else
 {
    Debug.Log("Login Gui window closed, renable your OnGUI buttons here");
 }
});

Idnet.I.Register(loginRegisterException => {
 if (Idnet.User.LoggedIn())
 {
    // Callback: Login succesfull.
    Debug.Log("User logged in: " + "Nickname " + Idnet.User.Current.Nickname);
 }
 else
 {
    Debug.Log("Register Gui window closed, renable your OnGUI buttons here");
 }
});

Idnet.I.Leaderboard((leaderboard, leaderboardException) => {
    Debug.Log("Leaderboard Gui window closed, renable your OnGUI buttons here");
});

Idnet.I.ListAchievements((listAchievementException) => {
    Debug.Log("Achievement Gui window closed, renable your OnGUI buttons here");
});

Way 1 : You can use Idnet.I.OpenLink("url") and call it on a unity MouseDown event.

See the following examples: OnMouseDown, OnPointerDown.

Way 2 : Attach PressHandler.cs on button and and call Idnet.I.OpenLink("url").

This workaround only works on MouseDown events and not the legacy Gui(Gui.Button()).

How to fix Table name not provided error?

Make sure you have created a table name (Eg. “LEADERBOARD”) as explained on the Table Setup page.

How to logout from an account?

Inside the Unity editor, your login details will be cached. This caching setup has been done so as to prevent you from logging in to Y8 Account each time you test your game. To clear this cache, Hold Shift & P while in the Editor Play Mode, then Logout from the menu.