void OnDisable() { if (ActiveInstance == this) ActiveInstance = null; EditorApplication.update -= BUpdate; #if UNITY_5_3 Selection.selectionChanged -= OnSelectionChanged; #endif Tools.hidden = false; CleanAllCameras(); ResetSceneColor(); }
/// <summary> /// Initialization /// </summary> void OnEnable() { _camera = GetComponent<Camera>(); EditorApplication.RepaintHierarchyWindow(); EnsureSingle(); if(AutoDiscover) TryAutoCollectPostFx(); // Subscribe to Editor events EditorApplication.update += UpdateBeholdR; if(!MatchCameraColor) CacheSceneColor(); ActiveInstance = this; }
void OnEnable() { BeholdR[] all = FindObjectsOfType<BeholdR>(); for (int i = 0; i < all.Length; i++) all[i].enabled = all[i] == this; ActiveInstance = this; _camera = GetComponent<Camera>(); CacheSceneColor(); AreGizmosHidden = AreGizmosHidden; EditorApplication.update += BUpdate; #if UNITY_5_3 Selection.selectionChanged += OnSelectionChanged; #endif OnSelectionChanged(); }
/// <summary> /// Clear the effects of this instance. Called also just before OnDestroy /// </summary> void OnDisable() { // Unsubscribe from Editor events EditorApplication.update -= UpdateBeholdR; if(ActiveInstance == this) { ActiveInstance = null; } CleanAllSceneCameras(); ResetSceneColor(); }