Exemple #1
0
        static void HandleOnPlayModeChanged()
        {
            // Ensure we don't leak system handles in the DLL
            if (EditorApplication.isPlayingOrWillChangePlaymode &&
                !EditorApplication.isPaused)
            {
                DestroySystem();
            }

            if (RuntimeManager.IsInitialized)
            {
                if (EditorApplication.isPlayingOrWillChangePlaymode)
                {
                    if (EditorApplication.isPaused)
                    {
                        RuntimeManager.GetBus("bus:/").setPaused(true);
                        RuntimeManager.StudioSystem.update();
                    }
                    else
                    {
                        RuntimeManager.GetBus("bus:/").setPaused(false);
                    }
                }
            }
        }
 static void HandleOnPausedModeChanged(PauseState state)
 {
     if (RuntimeManager.IsInitialized && RuntimeManager.HasBanksLoaded)
     {
         RuntimeManager.GetBus("bus:/").setPaused(EditorApplication.isPaused);
         RuntimeManager.StudioSystem.update();
     }
 }
Exemple #3
0
        static void HandleOnPlayModeChanged()
        {
            // Entering Play Mode will cause scripts to reload, losing all state
            // This is the last chance to clean up FMOD and avoid a leak.
            if (EditorApplication.isPlayingOrWillChangePlaymode &&
                !EditorApplication.isPaused)
            {
                DestroySystem();
            }

            if (RuntimeManager.IsInitialized && RuntimeManager.HasBanksLoaded)
            {
                if (EditorApplication.isPlayingOrWillChangePlaymode)
                {
                    RuntimeManager.GetBus("bus:/").setPaused(EditorApplication.isPaused);
                    RuntimeManager.StudioSystem.update();
                }
            }
        }