Quick Start

This page helps you get the plugin running as fast as possible. For advanced functionalities we recommend to check the Complete API.

Same code works for both Android and iOS platforms.

Login

Call this method only once at the beginning of the game to login the user.

public class Test : MonoBehaviour
{
    void Start()
    {
        Gley.GameServices.API.LogIn();
    }
}

Submit Achievement

public class Test : MonoBehaviour
{
    public void SubmitAchievement()
    {
        Gley.GameServices.API.SubmitAchievement(AchievementNames.LowJumper);
    }
}

AchievementNames is the enum generated from Settings Window.

Show achievements UI

This is generated by the store(Google Play/App Store) and it cannot be customized.

public class Test : MonoBehaviour
{
    public void ShowAchievementsUI()
    {
        Gley.GameServices.API.ShowAchievementsUI();
    }
}

Submit score

public class Test : MonoBehaviour
{
    long score = 100;
    public void SubmitScore()
    {
        Gley.GameServices.API.SubmitScore(score, LeaderboardNames.HighestJumpers);
    }
}

Show leaderboards UI

public class Test : MonoBehaviour
{
    public void ShowLeaderboardsUI()
    {
        Gley.GameServices.API.ShowLeaderboadsUI();
    }
}

This concludes the Quick Start. Check the Complete API for advanced functionalities.

For a complete example check the scene included in the package:

Assets/Gley/GameServices/Example/GameServicesExample.unity

Last updated