Ejemplo n.º 1
0
 private static void Login(string whyMessage)
 {
     if (!LoginWindow.IsLoggedIn)
     {
         LoginWindow.Login(whyMessage, new LoginWindow.LoginCallback(AssetStoreManager.OnLoggedIn));
     }
     else
     {
         AssetStoreManager.OnLoggedIn(null);
     }
 }
Ejemplo n.º 2
0
        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;
            }
        }
Ejemplo n.º 3
0
 public static void Login(string loginReason, LoginWindow.LoginCallback callback)
 {
     LoginWindow.Login(loginReason, callback, new Rect(100f, 100f, 360f, 180f));
 }