private void RenderToolbar() { GUILayout.FlexibleSpace(); bool enabled = GUI.enabled; GUI.enabled = !this.m_PackageController.IsUploading; if (GUILayout.Button("Refresh Packages", EditorStyles.toolbarButton, new GUILayoutOption[0])) { this.RefreshPackages(); } if (AssetStoreManager.sDbgButtons) { GUILayout.Label("Debug: ", AssetStoreManager.Styles.ToolbarLabel, new GUILayoutOption[0]); if (GUILayout.Button("FileSelector", EditorStyles.toolbarButton, new GUILayoutOption[0])) { FileSelector.Show("/", new List <string>(), delegate(List <string> newList) { foreach (string str in newList) { DebugUtils.Log(str); } }); } if (GUILayout.Button("Logout", EditorStyles.toolbarButton, new GUILayoutOption[0])) { AssetStoreClient.Logout(); } } GUI.enabled = enabled; }
private static void AssetStoreLogout() { DebugUtils.Log("Logged out of Asset Store"); AssetStoreManager assetStoreManager = (AssetStoreManager)EditorWindow.GetWindow(typeof(AssetStoreManager), false, "Package Upload"); assetStoreManager.Close(); AssetStoreClient.Logout(); }
private static void AssetStoreLogout() { if (EditorUtility.DisplayDialog("Logout Confirmation", "Are you sure you want to log out of Asset Store Tools?", "Confirm", "Cancel")) { DebugUtils.Log("Logged out of Asset Store"); AssetStoreManager assetStoreManager = (AssetStoreManager)EditorWindow.GetWindow(typeof(AssetStoreManager), false, "Package Upload"); assetStoreManager.Close(); AssetStoreClient.Logout(); } }
private void Login() { this.m_LoginRemoteMessage = null; if (AssetStoreClient.HasActiveSessionID) { AssetStoreClient.Logout(); } if (string.IsNullOrEmpty(this.m_Email)) { this.m_LoginRemoteMessage = "Please enter your email address."; this.Repaint(); return; } if (!this.IsValidEmail(this.m_Email)) { this.m_LoginRemoteMessage = "Invalid email address."; this.Repaint(); return; } if (string.IsNullOrEmpty(this.m_Password)) { this.m_LoginRemoteMessage = "Please enter your password."; this.Repaint(); return; } AssetStoreClient.LoginWithCredentials(this.m_Email, this.m_Password, AssetStoreClient.RememberSession, delegate(string errorMessage) { this.m_LoginRemoteMessage = errorMessage; if (errorMessage == null) { if (this.m_LoginCallback != null) { this.m_LoginCallback(this.m_LoginRemoteMessage); } base.Close(); } else { this.Repaint(); } }); }
private void Login() { this.m_LoginRemoteMessage = null; if (AssetStoreClient.HasActiveSessionID) { AssetStoreClient.Logout(); } AssetStoreClient.LoginWithCredentials(this.m_Username, this.m_Password, AssetStoreClient.RememberSession, delegate(string errorMessage) { this.m_LoginRemoteMessage = errorMessage; if (errorMessage == null) { base.Close(); } else { base.Repaint(); } }); }
private void RenderDebug() { if (AssetStoreManager.sDbgButtons) { GUILayout.FlexibleSpace(); GUILayout.Label("Debug: ", AssetStoreManager.Styles.ToolbarLabel, new GUILayoutOption[0]); if (GUILayout.Button("FileSelector", EditorStyles.toolbarButton, new GUILayoutOption[0])) { FileSelector.Show("/", new List <string>(), delegate(List <string> newList) { foreach (string str in newList) { DebugUtils.Log(str); } }); } if (GUILayout.Button("Reload", EditorStyles.toolbarButton, new GUILayoutOption[0])) { AssetStoreAPI.GetMetaData(this.Account, this.m_PackageDataSource, delegate(string errMessage) { if (errMessage != null) { Debug.LogError("Error fetching metadata: " + errMessage); LoginWindow.Logout(); AssetStoreManager.Login("Login to fetch current list of published packages"); base.Repaint(); return; } this.m_PackageController.AutoSetSelected(this); base.Repaint(); }); } if (GUILayout.Button("Logout", EditorStyles.toolbarButton, new GUILayoutOption[0])) { AssetStoreClient.Logout(); } } }
public static void Login(string loginReason, LoginWindow.LoginCallback callback, Rect windowRect) { if (AssetStoreClient.HasActiveSessionID) { AssetStoreClient.Logout(); } if (UnityConnectSession.instance.LoggedIn()) { AssetStoreClient.LoginWithAccessToken(delegate(string errorMessage) { if (string.IsNullOrEmpty(errorMessage)) { callback(errorMessage); } else { LoginWindow.ShowLoginWindow(loginReason, callback, windowRect); } }); return; } if (!AssetStoreClient.RememberSession || !AssetStoreClient.HasSavedSessionID) { LoginWindow.ShowLoginWindow(loginReason, callback, windowRect); return; } AssetStoreClient.LoginWithRememberedSession(delegate(string errorMessage) { if (string.IsNullOrEmpty(errorMessage)) { callback(errorMessage); } else { LoginWindow.ShowLoginWindow(loginReason, callback, windowRect); } }); }
public static void Logout() { AssetStoreClient.Logout(); }