Example #1
0
    static ToggleSceneViewFxOnPlayMode()
    {
        EditorApplication.playModeStateChanged += HandlePlayModeStateChange;
        EditorApplication.pauseStateChanged    += HandlePauseStateChange;
        EditorApplication.projectChanged       += TemporarilyDisableFx;

        controller = SceneViewFXController.instance;
    }
Example #2
0
 // On Pause, if we were maximized and the cachedEnableState is on, enable the SceneViewFX
 // On Unpause, if we were maximized and the SceneViewFX is on, cache their state and turn SceneViewFX off
 static void HandlePauseStateChange(PauseState pauseStatus)
 {
     if (GameWindow.instance.maximizeOnPlay && EditorApplication.isPlaying)
     {
         // Paused
         if (pauseStatus == PauseState.Paused)
         {
             controller = SceneViewFXController.instance;
             RestoreFxAsync(1500);
         }
         // Unpaused
         else
         {
             TemporarilyDisableFx();
         }
     }
 }