Esempio n. 1
0
 private static void Launch()
 {
     if (Application.webSecurityEnabled)
     {
         bool flag = EditorUtility.DisplayDialog("Web player platform active", "You are currently using the Web Player platform. To upload Asset Store packages please switch platform to PC and Mac standalone in File -> Build Settings...", "Switch my Active Platform.", "Cancel");
         if (!flag)
         {
             return;
         }
         try
         {
             Assembly   assembly = Assembly.Load("UnityEditor");
             Type       type     = assembly.GetType("UnityEditor.EditorUserBuildSettings");
             MethodInfo method   = type.GetMethod("SwitchActiveBuildTarget");
             method.Invoke(null, new object[]
             {
                 EditorUserBuildSettings.selectedStandaloneTarget
             });
         }
         catch
         {
             DebugUtils.LogError("Unable to invoke UnityEditor.EditorUserBuildSettings");
         }
     }
     EditorApplication.update = (EditorApplication.CallbackFunction)Delegate.Remove(EditorApplication.update, new EditorApplication.CallbackFunction(AssetStoreClient.Update));
     EditorApplication.update = (EditorApplication.CallbackFunction)Delegate.Combine(EditorApplication.update, new EditorApplication.CallbackFunction(AssetStoreClient.Update));
     AssetStoreManager.Login("Login to fetch current list of published packages");
 }
Esempio n. 2
0
 private static void Launch()
 {
     EditorApplication.update -= new EditorApplication.CallbackFunction(AssetStoreClient.Update);
     EditorApplication.update += new EditorApplication.CallbackFunction(AssetStoreClient.Update);
     if (!AssetStoreManager.isOpen)
     {
         AssetStoreManager.Login("To upload packages, please log in to your Asset Store Publisher account.");
     }
 }
Esempio n. 3
0
 private void RefreshPackages()
 {
     this.Account.mStatus = AssetStorePublisher.Status.Loading;
     AssetStoreAPI.GetMetaData(this.Account, this.m_PackageDataSource, (string errMessage) => {
         if (errMessage == null)
         {
             this.m_PackageController.AutoSetSelected(this);
             this.Repaint();
             return;
         }
         Debug.LogError(string.Concat("Error fetching metadata: ", errMessage));
         LoginWindow.Logout();
         AssetStoreManager.Login("To upload packages, please log in to your Asset Store Publisher account.");
         this.Repaint();
     });
 }
Esempio n. 4
0
 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 current in newList)
                 {
                     DebugUtils.Log(current);
                 }
             });
         }
         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();
         }
     }
 }
Esempio n. 5
0
    private void RenderMenu()
    {
        GUILayout.BeginHorizontal(EditorStyles.toolbar, new GUILayoutOption[0]);
        GUILayout.FlexibleSpace();
        this.RenderToolbar();
        GUILayout.EndHorizontal();
        bool flag = false;

        if (LoginWindow.IsLoggedIn)
        {
            if (this.Account.mStatus == AssetStorePublisher.Status.NotLoaded)
            {
                this.Account.mStatus = AssetStorePublisher.Status.Loading;
                AssetStoreAPI.GetMetaData(this.Account, this.m_PackageDataSource, (string errMessage) => {
                    if (errMessage == null)
                    {
                        this.m_PackageController.AutoSetSelected(this);
                        this.Repaint();
                        return;
                    }
                    Debug.LogError(string.Concat("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();
                });
            }
            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 flag1 = GUI.enabled;
                if (this.Account.mStatus != AssetStorePublisher.Status.Existing)
                {
                    GUI.enabled = false;
                }
                GUI.enabled = flag1;
                flag        = true;
            }
        }
        else
        {
            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();
        }
        if (!flag && this.m_PackageController.SelectedPackage != null)
        {
            this.m_PackageController.SelectedPackage = null;
        }
    }
Esempio n. 6
0
    private void RenderMenu()
    {
        GUILayout.BeginHorizontal(EditorStyles.toolbar, new GUILayoutOption[0]);
        GUILayout.FlexibleSpace();
        this.RenderDebug();
        GUILayout.EndHorizontal();
        bool flag = false;

        if (!LoginWindow.IsLoggedIn)
        {
            if (!LoginWindow.IsVisible)
            {
                LoginWindow.Login("Please re-login to asset store in order to fetch publisher details", new LoginWindow.LoginCallback(AssetStoreManager.OnLoggedIn), GUIUtil.RectOnRect(360f, 140f, 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("Login to fetch current list of published packages");
                        base.Repaint();
                        return;
                    }
                    this.m_PackageController.AutoSetSelected(this);
                    base.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();
                base.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;
        }
    }