Exemplo n.º 1
0
    /// <summary>
    /// Initializes the API.  You must do this before anything else.
    /// </summary>
    /// <param name="publickey">
    /// A <see cref="System.String"/>
    /// </param>
    /// <param name="privatekey">
    /// A <see cref="System.String"/>
    /// </param>
    /// <param name="apiurl">
    /// A <see cref="System.String"/>
    /// </param>
    public static void Initialize(string publickey, string privatekey, string apiurl)
    {
        if (_instance != null)
        {
            return;
        }

        // Add Unity Extentions to LitJson
        LitJson.JsonExtend.AddExtentds();

        GameObject go = new GameObject("playtomic");

        GameObject.DontDestroyOnLoad(go);

        _instance = go.AddComponent("Playtomic") as Playtomic;
        _instance._leaderboards     = new PLeaderboards();
        _instance._playerlevels     = new PPlayerLevels();
        _instance._geoip            = new PGeoIP();
        _instance._gamevars         = new PGameVars();
        _instance._achievements     = new PAchievements();
        _instance._newsletter       = new PNewsletter();
        _instance._playerchallenges = new PPlayerChallenges();
        _instance._playerprofiles   = new PPlayerProfiles();

        PRequest.Initialise(publickey, privatekey, apiurl);
    }
Exemplo n.º 2
0
    /// <summary>
    /// Initializes the API.  You must do this before anything else.
    /// </summary>
    /// <param name="publickey">
    /// A <see cref="System.String"/>
    /// </param>
    /// <param name="privatekey">
    /// A <see cref="System.String"/>
    /// </param>
    /// <param name="apiurl">
    /// A <see cref="System.String"/>
    /// </param>
    public static void Initialize(string publickey, string privatekey, string apiurl)
    {
        if (_instance != null)
        {
            return;
        }

        var go = new GameObject("playtomic");

        GameObject.DontDestroyOnLoad(go);

        _instance = go.AddComponent("Playtomic") as Playtomic;
        _instance._leaderboards = new PLeaderboards();
        _instance._playerlevels = new PPlayerLevels();
        _instance._geoip        = new PGeoIP();
        _instance._gamevars     = new PGameVars();
        _instance._achievements = new PAchievements();
        _instance._newsletter   = new PNewsletter();

        PRequest.Initialise(publickey, privatekey, apiurl);
    }
Exemplo n.º 3
0
 public static void SetCredentials(string publickey, string privatekey, string apiurl)
 {
     PRequest.Initialise(publickey, privatekey, apiurl);
 }