Exemplo n.º 1
0
    void OnUserAuthenticationChanged(bool state)
    {
        if (state == true)
        {
            Settings = UserSettings.Load(CloudUser.instance.primaryKey);
            GuiOptions.Load();

            PlayerPersistantInfo ppi = PPIManager.Instance.GetLocalPPI();
            ppi.PrimaryKey     = CloudUser.instance.primaryKey;
            ppi.PrimaryKeyHash = CloudServices.CalcHash64(ppi.PrimaryKey);

            if (ppi.Experience == 0 && PlayerPrefs.HasKey("firstrun") == false)
            {
                ppi.IsFirstRun = true;
                PlayerPrefs.SetInt("firstrun", 0);
            }

            TapJoy.ConnectUser(ppi.PrimaryKey);
        }
        else
        {
            SaveSettings();
            TapJoy.DisconnectUser();
        }
    }