Пример #1
0
 static void HandleChange(PlayModeStateChange aChange)
 {
     if (aChange == PlayModeStateChange.ExitingEditMode)
     {
         EditInIsolation.DisableObjects();
     }
     if (aChange == PlayModeStateChange.EnteredEditMode)
     {
         EditInIsolation.EnableObjects();
     }
 }
Пример #2
0
 static void HandleChange()
 {
     // Disable objects -before- we start playing. Don't want Awake events.
     if (!wasPlayingPre && EditorApplication.isPlayingOrWillChangePlaymode)
     {
         EditInIsolation.DisableObjects();
     }
     // Enable objects -after- playing has ended. Don't want Unity to restore original disabled state afterwards
     if (wasPlayingPost && !EditorApplication.isPlaying)
     {
         EditInIsolation.EnableObjects();
     }
     wasPlayingPre  = EditorApplication.isPlayingOrWillChangePlaymode;
     wasPlayingPost = EditorApplication.isPlaying;
 }