public void OnLoginSuccess(string appotaSession) { // Get User info from AppotaSession AppotaSession appotaSessionObj = new AppotaSession(appotaSession); AppotaSession.Instance.UpdateInstance(appotaSessionObj); Debug.Log("AppotaSDK: Did login"); }
void OnGUI() { ScreenWidth = Screen.width; ScreenHeight = Screen.height; GUIStyle customButton = new GUIStyle("button"); customButton.fontSize = 30; if (GUI.Button(new Rect(ScreenWidth / 3, 40, ScreenWidth / 3, ScreenHeight / 10), "Login", customButton)) { AppotaSDKHandler.Instance.ShowLoginView(); } if (GUI.Button(new Rect(ScreenWidth / 3, 50 + ScreenHeight / 10, ScreenWidth / 3, ScreenHeight / 10), "Logout", customButton)) { AppotaSDKHandler.Instance.Logout(); } if (GUI.Button(new Rect(ScreenWidth / 3, 60 + 2 * ScreenHeight / 10, ScreenWidth / 3, ScreenHeight / 10), "Switch Account", customButton)) { AppotaSDKHandler.Instance.SwitchAccount(); } AppotaSession appotaSession = AppotaSDKHandler.Instance.GetAppotaSession(); text = "UserID: " + appotaSession.UserID; GUI.TextArea(new Rect(10, 40, ScreenWidth / 4, ScreenHeight / 10), text, 200, customButton); if (AppotaSDKHandler.Instance.IsUserLoggedIn()) { if (GUI.Button(new Rect(ScreenWidth / 3, 70 + 3 * ScreenHeight / 10, ScreenWidth / 3, ScreenHeight / 10), "User Info", customButton)) { AppotaSDKHandler.Instance.ShowUserInfoView(); } if (GUI.Button(new Rect(ScreenWidth / 3, 80 + 4 * ScreenHeight / 10, ScreenWidth / 3, ScreenHeight / 10), "Payment", customButton)) { AppotaSDKHandler.Instance.ShowPaymentView(); } if (GUI.Button(new Rect(ScreenWidth / 3, 90 + 5 * ScreenHeight / 10, ScreenWidth / 3, ScreenHeight / 10), "Payment With Package", customButton)) { AppotaSDKHandler.Instance.ShowPaymentViewWithPackageID("app.pkid.tym4K"); } } }
public void UpdateInstance(AppotaSession instance) { _instance = instance; }
public void OnLoginSuccess(string appotaSession) { // Get User info from AppotaSession AppotaSession appotaSessionObj = new AppotaSession(appotaSession); AppotaSession.Instance.UpdateInstance(appotaSessionObj); Debug.Log ("AppotaSDK: Did login"); }