// Use this for initialization void Start () { RuntimeData.I.Load (); AudioManagerScript.I.Load(); //ProductManager.I.Load(); if(!PlayerManager.I.player.verificationComplete) { SceneManager.LoadScene("First_Login"); } else { if (!PlayerManager.I.player.loggedIn) { SceneManager.LoadScene("Login"); } else { if (PlayerManager.I.player.createdProfile) { if (!PlayerManager.I.player.completedIntro) { sceneName = "Introduction"; } else { sceneName = "Home"; } } else { sceneName = "Profile_Create"; } GamedoniaUsers.LoginUserWithSessionToken (delegate (bool success) { if (success) { ProductManager.I.RequestProducts(); PlayerManager.I.LoadFriends (); if(sceneName == "Home") { Loader.I.enableLoader(); StartCoroutine(waitBeforeInformationIsProcessed()); } else { SceneManager.LoadScene (sceneName); } } else { SceneManager.LoadScene ("Login"); } }); } } }//end start
public void Authenticate(Action <bool> callback) { if (Gamedonia.INSTANCE.debug) { Debug.Log("Session Token Authentication"); } this.callback = callback; string session_token = PlayerPrefs.GetString("gd_session_token"); if (!String.IsNullOrEmpty(session_token)) { GamedoniaUsers.LoginUserWithSessionToken(ProcessLogin); } else { Debug.LogError("Session Token not present impossible to perform login with it"); if (this.callback != null) { callback(false); } } }