Example #1
0
        void OnDisable()
        {
            if (ActiveInstance == this)
                ActiveInstance = null;

            EditorApplication.update -= BUpdate;

#if UNITY_5_3
            Selection.selectionChanged -= OnSelectionChanged;
#endif

            Tools.hidden = false;
            CleanAllCameras();
            ResetSceneColor();
        }
Example #2
0
        /// <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;
        }
Example #3
0
        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();
        }
Example #4
0
        /// <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();
        }