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; }
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(); }