void OnEnable() { hierarchy = new BlockoutHierarchy(); BlockoutStaticFunctions.FindHeirachy(ref hierarchy); EUIResourceManager rm = EUIResourceManager.Instance; splashScreen = new BlockoutEditorSplashSection(); splashScreen.InitSection("Splash Section", hierarchy); assetsSection = new BlockoutEditorAssetsSection(); assetsSection.InitSection("Blockout Assets", hierarchy); scalableObjectsSection = new BlockoutEditorScalableObjectsSection(); scalableObjectsSection.InitSection("Scalable Objects", hierarchy); transformSection = new BlockoutEditorTransformSection(); transformSection.InitSection("Transform Controls", hierarchy); othersSection = new BlockoutEditorOthersSection(); othersSection.InitSection("Others", hierarchy); cameraAnchorSection = new BlockoutEditorCameraAnchorSection(); cameraAnchorSection.InitSection("Camera Anchors", hierarchy); gridSnapping = new BlockoutGridSnapping(); gridSnapping.InitSection("Grid Snapping", hierarchy); hierarchyTools = new BlockoutEditorHierarchyToolsSection(); hierarchyTools.InitSection("Hierarchy Tools", hierarchy); commentsSection = new BlockoutEditorCommentsSection(); commentsSection.InitSection("Comments", hierarchy); suggestedSection = new BlockoutEditorSuggestedSection(); suggestedSection.InitSection("Suggesstions", hierarchy); titleContent = new GUIContent("Blockout", EUIResourceManager.Instance.GetTexture(EditorGUIUtility.isProSkin ? "Blockout_Icon_Light" : "Blockout_Icon_Dark")); sections = new BlockoutEditorSection[] { assetsSection, scalableObjectsSection, transformSection, gridSnapping, hierarchyTools, commentsSection, suggestedSection, cameraAnchorSection, othersSection }; BlockoutEditorSettings.CurrentSceneSetting = Resources.LoadAll <BlockoutSceneSettings>("") .First(x => x.sceneName == SceneManager.GetActiveScene().name); isVisible = true; BlockoutEditorHelper.Awake(this); EditorHotkeysTracker.Init(this); BlockoutStaticFunctions.UpdateAvailable(out newVersion); splashScreen.newVersion = newVersion; }
void OnDisable() { isVisible = false; BlockoutEditorHelper.Destroy(); EditorHotkeysTracker.Destroy(); }