private void RefreshPackages() { this.Account.mStatus = AssetStorePublisher.Status.Loading; AssetStoreAPI.GetMetaData(this.Account, this.m_PackageDataSource, delegate(string errMessage) { if (errMessage != null) { Debug.LogError("Error fetching metadata: " + errMessage); LoginWindow.Logout(); AssetStoreManager.Login("To upload packages, please log in to your Asset Store Publisher account."); this.Repaint(); return; } this.m_PackageController.AutoSetSelected(this); this.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(); } } }
private void RenderMenu() { GUILayout.BeginHorizontal(EditorStyles.toolbar, new GUILayoutOption[0]); GUILayout.FlexibleSpace(); this.RenderToolbar(); GUILayout.EndHorizontal(); bool flag = false; if (!LoginWindow.IsLoggedIn) { if (!LoginWindow.IsVisible) { LoginWindow.Login("To upload packages, please log in to your Asset Store Publisher account.", new LoginWindow.LoginCallback(AssetStoreManager.OnLoggedIn), GUIUtil.RectOnRect(360f, 180f, base.position)); } GUILayout.BeginVertical(new GUILayoutOption[0]); GUILayout.Space(10f); GUILayout.BeginHorizontal(new GUILayoutOption[0]); GUILayout.FlexibleSpace(); GUILayout.Label(GUIUtil.StatusWheel, new GUILayoutOption[0]); GUILayout.Label("Please login", new GUILayoutOption[0]); GUILayout.FlexibleSpace(); GUILayout.EndHorizontal(); GUILayout.EndVertical(); } else { if (this.Account.mStatus == AssetStorePublisher.Status.NotLoaded) { this.Account.mStatus = AssetStorePublisher.Status.Loading; AssetStoreAPI.GetMetaData(this.Account, this.m_PackageDataSource, delegate(string errMessage) { if (errMessage != null) { Debug.LogError("Error fetching metadata: " + errMessage); LoginWindow.Logout(); AssetStoreManager.Login("To upload packages, please log in to your Asset Store Publisher account.", "Account is not registered as a Publisher. \nPlease create a Publisher ID."); this.Repaint(); return; } this.m_PackageController.AutoSetSelected(this); this.Repaint(); }); } if (this.Account.mStatus == AssetStorePublisher.Status.NotLoaded || this.Account.mStatus == AssetStorePublisher.Status.Loading) { GUILayout.BeginVertical(new GUILayoutOption[0]); GUILayout.Space(10f); GUILayout.BeginHorizontal(new GUILayoutOption[0]); GUILayout.FlexibleSpace(); GUILayout.Label(GUIUtil.StatusWheel, new GUILayoutOption[0]); GUILayout.Label("Fetching account information", new GUILayoutOption[0]); GUILayout.FlexibleSpace(); GUILayout.EndHorizontal(); GUILayout.EndVertical(); this.Repaint(); } else { bool enabled = GUI.enabled; if (this.Account.mStatus != AssetStorePublisher.Status.Existing) { GUI.enabled = false; } GUI.enabled = enabled; flag = true; } } if (!flag && this.m_PackageController.SelectedPackage != null) { this.m_PackageController.SelectedPackage = null; } }