void OnEnable() { string installPath = FindInstallPath(); addHullIcon = AssetDatabase.LoadAssetAtPath <Texture> (installPath + "AddHullIcon.png"); errorIcon = AssetDatabase.LoadAssetAtPath <Texture> (installPath + "ErrorIcon.png"); deleteIcon = AssetDatabase.LoadAssetAtPath <Texture> (installPath + "DeleteIcon.png"); paintOnIcon = AssetDatabase.LoadAssetAtPath <Texture> (installPath + "PaintOnIcon.png"); paintOffIcon = AssetDatabase.LoadAssetAtPath <Texture> (installPath + "PaintOffIcon.png"); triggerOnIcon = AssetDatabase.LoadAssetAtPath <Texture> (installPath + "TriggerOnIcon.png"); triggerOffIcon = AssetDatabase.LoadAssetAtPath <Texture> (installPath + "TriggerOffIcon.png"); Texture icon = AssetDatabase.LoadAssetAtPath <Texture> (installPath + "TechnieIcon.png"); #if UNITY_5_0 this.title = "Hull Painter"; #else this.titleContent = new GUIContent("Hull Painter", icon, "Technie Hull Painter"); #endif sceneManipulator = new SceneManipulator(); isOpen = true; instance = this; }
void OnDestroy() { // Debug.Log("WINDOW.OnDestroy"); SceneView.onSceneGUIDelegate -= this.OnSceneGUI; sceneManipulator.Destroy(); sceneManipulator = null; isOpen = false; instance = null; }
void OnEnable() { string installPath = FindInstallPath(); dividerColour = new Color(116.0f / 255.0f, 116.0f / 255.0f, 116.0f / 255.0f); addHullIcon = AssetDatabase.LoadAssetAtPath <Texture> (installPath + "AddHullIcon.png"); errorIcon = AssetDatabase.LoadAssetAtPath <Texture> (installPath + "ErrorIcon.png"); deleteIcon = AssetDatabase.LoadAssetAtPath <Texture> (installPath + "DeleteIcon.png"); paintOnIcon = AssetDatabase.LoadAssetAtPath <Texture> (installPath + "PaintOnIcon.png"); paintOffIcon = AssetDatabase.LoadAssetAtPath <Texture> (installPath + "PaintOffIcon.png"); triggerOnIcon = AssetDatabase.LoadAssetAtPath <Texture> (installPath + "TriggerOnIcon.png"); triggerOffIcon = AssetDatabase.LoadAssetAtPath <Texture> (installPath + "TriggerOffIcon.png"); isChildIcon = AssetDatabase.LoadAssetAtPath <Texture>(installPath + "TriggerOnIcon.png"); nonChildIcon = AssetDatabase.LoadAssetAtPath <Texture>(installPath + "TriggerOffIcon.png"); preciseBrushIcon = AssetDatabase.LoadAssetAtPath <Texture>(installPath + "PreciseBrushIcon.png"); smallBrushIcon = AssetDatabase.LoadAssetAtPath <Texture>(installPath + "SmallBrushIcon.png"); mediumBrushIcon = AssetDatabase.LoadAssetAtPath <Texture>(installPath + "MediumBrushIcon.png"); largeBrushIcon = AssetDatabase.LoadAssetAtPath <Texture>(installPath + "LargeBrushIcon.png"); pipetteIcon = AssetDatabase.LoadAssetAtPath <Texture>(installPath + "PipetteIcon.png"); hullVisibleIcon = AssetDatabase.LoadAssetAtPath <Texture>(installPath + "HullVisibleIcon.png"); hullInvisibleIcon = AssetDatabase.LoadAssetAtPath <Texture>(installPath + "HullInvisibleIcon.png"); toolsIcons = AssetDatabase.LoadAssetAtPath <Texture>(installPath + "ToolsIcon.png"); hullsIcon = AssetDatabase.LoadAssetAtPath <Texture>(installPath + "HullIcon.png"); settingsIcon = AssetDatabase.LoadAssetAtPath <Texture>(installPath + "SettingsIcon.png"); assetsIcon = AssetDatabase.LoadAssetAtPath <Texture>(installPath + "AssetsIcon.png"); Texture icon = AssetDatabase.LoadAssetAtPath <Texture> (installPath + "TechnieIcon.png"); #if UNITY_5_0 this.title = "Hull Painter"; #else this.titleContent = new GUIContent("Hull Painter", icon, "Technie Hull Painter"); #endif sceneManipulator = new SceneManipulator(); isOpen = true; instance = this; }
void OnDestroy() { #if UNITY_2019_1_OR_NEWER SceneView.duringSceneGui -= this.OnSceneGUI; SceneView.beforeSceneGui -= this.OnBeforeSceneGUI; #else SceneView.onSceneGUIDelegate -= this.OnSceneGUI; #endif if (sceneManipulator != null) { sceneManipulator.Destroy(); sceneManipulator = null; } isOpen = false; instance = null; }