void OnDisable() { instance = null; if(editor && editor.editLevel == EditLevel.Texture) editor.PopEditLevel(); // EditorApplication.delayCall -= this.Close; // not sure if this is necessary? pb_Editor.OnSelectionUpdate -= OnSelectionUpdate; pb_Object_Editor.OnGetFrameBoundsEvent -= OnGetFrameBoundsEvent; }
void OnEnable() { this.minSize = new Vector2(500f, 300f); InitGUI(); this.wantsMouseMove = true; /** * Register for delegates */ pb_Editor.OnSelectionUpdate += OnSelectionUpdate; if(editor != null) OnSelectionUpdate(editor.selection); instance = this; pb_Object_Editor.OnGetFrameBoundsEvent += OnGetFrameBoundsEvent; nearestElement.Clear(); // Find preferences pref_showMaterial = pb_Preferences_Internal.GetBool(pb_Constant.pbUVMaterialPreview); pref_gridSnapValue = pb_Preferences_Internal.GetFloat(pb_Constant.pbUVGridSnapValue); }