コード例 #1
0
ファイル: NGFavWindow.cs プロジェクト: Hengle/clapotis
        private void    Diagnose()
        {
            NGDiagnostic.Log(NGFavWindow.Title, "CurrentFav", this.currentSave);

            FavSettings settings = HQ.Settings.Get <FavSettings>();

            for (int i = 0; i < settings.favorites.Count; i++)
            {
                NGDiagnostic.Log(NGFavWindow.Title, "Fav[" + i + "]", JsonUtility.ToJson(settings.favorites[i]));
            }
        }
コード例 #2
0
 static NGHubWindow()
 {
     // In the case of NG Hub as dock, the layout won't load it at the second restart. Certainly due to the window's state as Popup, but it does not explain why it only occurs at the second restart.
     EditorApplication.delayCall += () =>
     {
         int forceRecreate = NGEditorPrefs.GetInt(NGHubWindow.ForceRecreateKeyPref + "_" + Application.dataPath, 0);
         NGDiagnostic.Log(NGHubWindow.Title, "ForceRecreate", forceRecreate);
         if (forceRecreate == (int)DockState.ProperlyDisabled && Resources.FindObjectsOfTypeAll <NGHubWindow>().Length == 0)
         {
             NGHubWindow.OpenAsDock();
         }
     };
 }
コード例 #3
0
        private void    Diagnose()
        {
            NGDiagnostic.Log(NGHubWindow.Title, "IsDocked", this.dockedAsMenu);
            NGDiagnostic.Log(NGHubWindow.Title, "HasExtension", this.extensionWindow != null);

            if (this.initialized == true)
            {
                NGDiagnostic.Log(NGHubWindow.Title, "Components", this.components.Count);

                for (int i = 0; i < this.components.Count; i++)
                {
                    NGDiagnostic.Log(NGHubWindow.Title, "Components[" + i + "]", JsonUtility.ToJson(this.components[i]).Insert(1, "\"type\":\"" + this.components[i].GetType().Name + "\","));
                }
            }
        }
コード例 #4
0
        protected virtual void  OnEnable()
        {
            Utility.RestoreIcon(this, NGHubWindow.TitleColor);

            Metrics.UseTool(4);             // NGHub

            NGChangeLogWindow.CheckLatestVersion(NGAssemblyInfo.Name);

            if (this.initialized == true || HQ.Settings == null)
            {
                return;
            }

            try
            {
                this.titleContent.text = NGHubWindow.Title;
                this.minSize           = Vector2.zero;
                this.components        = new List <HubComponent>();
                this.RestoreComponents();

                if (this.initOnce == false)
                {
                    this.backgroundColor = (Color)Utility.LoadEditorPref(this.backgroundColor, typeof(Color), NGHubWindow.BackgroundColorKeyPref);
                }

                HQ.SettingsChanged     += this.OnSettingsChanged;
                Undo.undoRedoPerformed += this.RestoreComponents;

                // Force repaint to hide part.
                EditorApplication.delayCall += EditorApplication.delayCall += this.Repaint;

                NGDiagnostic.DelayDiagnostic(this.Diagnose);

                if (this.dockedAsMenu == true)
                {
                    this.SetDockMode(true);
                }

                this.initialized = true;
            }
            catch (Exception ex)
            {
                this.errorPopup.exception = ex;
            }

            this.initOnce = true;
        }
コード例 #5
0
ファイル: NGFavWindow.cs プロジェクト: Hengle/clapotis
        protected virtual void  OnEnable()
        {
            Utility.RestoreIcon(this, NGFavWindow.TitleColor);

            Metrics.UseTool(3);             // NGFav

            NGChangeLogWindow.CheckLatestVersion(NGAssemblyInfo.Name);

            this.wantsMouseMove = true;

            this.minSize = new Vector2(this.minSize.x, 0F);

            this.horizontalScrolls = new List <HorizontalScrollbar>();
            this.delayToDelete     = -1;

            this.list = new ReorderableList(null, typeof(GameObject), true, false, false, false);
            this.list.showDefaultBackground = false;
            this.list.headerHeight          = 0F;
            this.list.footerHeight          = 0F;
            this.list.drawElementCallback   = this.DrawElement;
            this.list.onReorderCallback     = (ReorderableList list) => { HQ.InvalidateSettings(); };

            if (this.backgroundColor.a == 0F)
            {
                this.backgroundColor = (Color)Utility.LoadEditorPref(this.backgroundColor, typeof(Color), "NGFav.backgroundColor");
            }

            NGDiagnostic.DelayDiagnostic(this.Diagnose);

            HQ.SettingsChanged += this.CheckSettings;
            Utility.RegisterIntervalCallback(this.TryReconnectkNullObjects, NGFavWindow.ForceRepaintRefreshTick);
            RootGameObjectsManager.RootChanged += this.OnRootObjectsChanged;
            Undo.undoRedoPerformed             += this.Repaint;

            this.CheckSettings();
        }