コード例 #1
0
        void OnPlayModeChanged(PlayModeState currentMode, PlayModeState changedMode)
        {
            // Debug.Log(currentMode.ToString() + " => " + changedMode.ToString());
            if (currentMode == PlayModeState.Stopped && changedMode == PlayModeState.Playing)
            {
            }

            if (currentMode == PlayModeState.Playing && changedMode == PlayModeState.Paused)
            {
                //Pause in editor
                _applicationPause_pause   = IsPaused();
                _applicationPause_playing = IsPlaying();
                Pause();
            }

            if (currentMode == PlayModeState.Paused && changedMode == PlayModeState.Playing)
            {
                //Resume in editor

                if (_applicationPause_pause)
                {
                    // Pause();
                }
                else if (_applicationPause_playing)
                {
                    Play();
                }
            }
        }
コード例 #2
0
 private static void OnPlayModeStateChanged(PlayModeState playModeState)
 {
     if (playModeState == PlayModeState.ExitingPlayMode)
     {
         InjectFor_CurrentScene();
     }
 }
コード例 #3
0
        /// <summary>
        /// Unity callback called when playmode changes.
        /// Un-/Registered in the OnDisable/OnEnable.
        /// Updates the m_PlayModeState member and the activeParent.
        /// Creates or destroy the guiCallback.
        /// </summary>
        void OnPlaymodeChange()
        {
            // Update playmode
            if (EditorApplication.isPlaying)
            {
                m_PlayModeState = !EditorApplication.isPlayingOrWillChangePlaymode ? PlayModeState.SwitchingToEditor : PlayModeState.Playing;
            }
            else
            {
                m_PlayModeState = EditorApplication.isPlayingOrWillChangePlaymode ? PlayModeState.SwitchingToPlaymode : PlayModeState.Editor;
            }

            // if (/*!EditorApplication.isPaused &&*/ (EditorApplication.isPlayingOrWillChangePlaymode && EditorApplication.isPlaying || !EditorApplication.isPlayingOrWillChangePlaymode && !EditorApplication.isPlaying)) {
            if (m_PlayModeState == PlayModeState.Playing || m_PlayModeState == PlayModeState.Editor)
            {
                var parentID = m_SerializedParentID;
                activeParent               = null;
                activeParent               = EditorUtility.InstanceIDToObject(parentID) as ParentBehaviour;
                GUIUtility.hotControl      = 0;
                GUIUtility.keyboardControl = 0;
            }

            // Create guiCallback?
            if (m_PlayModeState == PlayModeState.SwitchingToEditor && m_GUICallback == null)
            {
                m_GUICallback = this.CreateGUICallback();
            }
            // Destroy guiCallback?
            else if (m_PlayModeState == PlayModeState.SwitchingToPlaymode && m_GUICallback != null)
            {
                DestroyImmediate(m_GUICallback.gameObject, true);
            }
        }
コード例 #4
0
 private void OnPlayModeChanged(PlayModeState currentState, PlayModeState changedState)
 {
     if (PlayModeChanged != null)
     {
         PlayModeChanged(currentState, changedState);
     }
 }
コード例 #5
0
 private static void OnPlayModeChanged(PlayModeState oldState, PlayModeState newState)
 {
     if (PlayModeChanged != null)
     {
         PlayModeChanged(oldState, newState);
     }
 }
コード例 #6
0
 private static void OnPlayModeChanged(PlayModeState currentMode, PlayModeState changedMode)
 {
     //Debug.Log("play mode changed");
     if (changedMode == PlayModeState.AboutToPlay)
     {
         PackedSpriteGroupEditor.AggregateAllAtlases();
     }
 }
コード例 #7
0
 static EditorPlayMode()
 {
     EditorApplication.playmodeStateChanged = OnUnityPlayModeChanged;
     if (EditorApplication.isPaused)
     {
         _currentState = PlayModeState.Paused;
     }
 }
コード例 #8
0
 internal void InvokePlayModeStateChanged(PlayModeState playModeState, PlayModeStateEvent e)
 {
     if (e == null)
     {
         return;
     }
     e.Invoke(playModeState);
 }
コード例 #9
0
 private static void OnPlayModeChanged(PlayModeState currentState, PlayModeState changedState)
 {
     if (changedState == PlayModeState.Stopped || (changedState == PlayModeState.Playing && currentState == PlayModeState.Stopped))
     {
         //if (LuaManagerStatus.LuaManagerInited)
         //    LuaManager.Clear();
     }
 }
コード例 #10
0
ファイル: Extentions.cs プロジェクト: pey849/House-Rules
 public static void OnPlayModeStateChanged(PlayModeState currentMode, PlayModeState changedMode)
 {
     if (currentMode == PlayModeState.Stopped && changedMode == PlayModeState.Playing ||
         currentMode == PlayModeState.AboutToPlay && changedMode == PlayModeState.Playing)
     {
         AirConsole controller = GameObject.FindObjectOfType <AirConsole>();
         OpenBrowser(controller, Application.dataPath + Settings.WEBTEMPLATE_PATH);
     }
 }
コード例 #11
0
        private static void OnUnityPlayModeChanged(PlayModeStateChange playModeStateChange)
        {
            var newState = GetPlayModeState;

            // Fire PlayModeChanged event.
            OnPlayModeChanged(_oldState, newState);
            // Set current state.
            _oldState = newState;
        }
コード例 #12
0
ファイル: Extentions.cs プロジェクト: ajgriesemer/GameDev
        public static void OnPlayModeStateChanged(PlayModeState currentMode, PlayModeState changedMode) {

            if (currentMode == PlayModeState.Stopped && changedMode == PlayModeState.Playing ||
                currentMode == PlayModeState.AboutToPlay && changedMode == PlayModeState.Playing) {

                AirConsole controller = GameObject.FindObjectOfType<AirConsole>();
                OpenBrowser(controller, Application.dataPath + Settings.WEBTEMPLATE_PATH);
            }
        }
コード例 #13
0
        static EditorPlayMode()
        {
#if UNITY_EDITOR
            EditorApplication.playmodeStateChanged = OnUnityPlayModeChanged;
            if (EditorApplication.isPaused)
            {
                _currentState = PlayModeState.Paused;
            }
            #endif
        }
コード例 #14
0
 private static void OnPlayModeChanged(PlayModeState oldState, PlayModeState newState)
 {
     if (newState == oldState || !isEnabled)
     {
         return;
     }
     ActiveLayoutSelection.Clear();
     TheIndex = -1;
     AddLayoutsOfCurrentModeToActive();
     EditorApplication.ExecuteMenuItem("Window/Layouts/Smart Layout/Quick Switch %l");
 }
コード例 #15
0
ファイル: PlayMode.cs プロジェクト: Luminoth/CatFight
        private static void OnUnityPlayModeChanged()
        {
            var changedState = PlayModeState.Stopped;

            int state = GetEditorAppStateBoolComb();

            switch (state)
            {
            case (22112):
                changedState = PlayModeState.Playing;
                break;

            case (21112):
                changedState = PlayModeState.Paused;
                break;

            case (22222):
                changedState = PlayModeState.Stopped;
                break;

            case (22122):
                changedState = PlayModeState.AboutToStop;
                break;

            case (21122):
                changedState = PlayModeState.AboutToStop;
                break;

            case (21222):
                changedState = PlayModeState.Stopped;
                break;

            case 22212:
                changedState = PlayModeState.Stopped;
                break;

            case 21212:
                changedState = PlayModeState.Paused;
                break;

            default:
                // Debug.Log("No such state combination defined: " + state);
                break;
            }

            // Fire PlayModeChanged event.
            if (_currentState != changedState)
            {
                OnPlayModeChanged(_currentState, changedState);
            }

            // Set current state.
            _currentState = changedState;
        }
    private static void OnUnityPlayModeChanged()
    {
        var changedState = PlayModeState.Stopped;

        switch (_currentState)
        {
        case PlayModeState.Stopped:
            if (EditorApplication.isPlayingOrWillChangePlaymode)
            {
                changedState = PlayModeState.Playing;
            }
            else if (EditorApplication.isPaused)
            {
                changedState = PlayModeState.Paused;
            }
            break;

        case PlayModeState.Playing:
            if (EditorApplication.isPaused)
            {
                changedState = PlayModeState.Paused;
            }
            else if (EditorApplication.isPlaying)
            {
                changedState = PlayModeState.Playing;
            }
            else
            {
                changedState = PlayModeState.Stopped;
            }
            break;

        case PlayModeState.Paused:
            if (EditorApplication.isPlayingOrWillChangePlaymode && !EditorApplication.isPaused)
            {
                changedState = PlayModeState.Playing;
            }
            else if (EditorApplication.isPlayingOrWillChangePlaymode && EditorApplication.isPaused)
            {
                changedState = PlayModeState.Paused;
            }
            break;

        default:
            return;
        }

        // Set current state.
        _currentState = changedState;
    }
コード例 #17
0
        /// <summary>
        /// A Unity callback called when the window is loaded.
        /// </summary>
        void OnEnable()
        {
            // Set window name
            this.name = Print.GetLogo() + " Behaviour";
            // Update singleton instance
            Instance = this;

            // Update NotVisible value
            BehaviourWindow.s_NotVisible = this.m_NotVisible;

            // Set playmode state
            if (m_PlayModeState == PlayModeState.Unknow)
            {
                m_PlayModeState = EditorApplication.isPlaying ? PlayModeState.Playing : PlayModeState.Editor;

                // The guiCallback is null and the unity application is not playing or changing playmode?
                if (m_GUICallback == null && !EditorApplication.isPlayingOrWillChangePlaymode)
                {
                    // Create game object
                    GameObject go = EditorUtility.CreateGameObjectWithHideFlags("GUI Object", HideFlags.HideAndDontSave, new System.Type[] { typeof(GUICallback) });
                    // Get GUICallback component
                    m_GUICallback = go.GetComponent <GUICallback>();
                }
            }

            // Set callbacks
            activeParentChanged += OnParentSelectionChange;
            activeNodeChanged   += OnNodeSelectionChange;
            EditorApplication.playmodeStateChanged   += OnPlaymodeChange;
            EditorApplication.delayCall              += OnDelayCall;
            LoadSceneUtility.onLoadScene             += this.OnLoadScene;
            BehaviourMachinePrefs.preferencesChanged += this.Repaint;

            // The minimum size of this window
            base.minSize = new Vector2(200f, 150f);

            // Forces selection update
            activeParent = EditorUtility.InstanceIDToObject(m_SerializedParentID) as ParentBehaviour;
            OnSelectionChange();
            activeNodeID = m_SerializedNodeID;

            // Set guiController
            SetParentGUI();

            // Automatically repaint window whenever the scene has change
            base.autoRepaintOnSceneChange = true;
        }
コード例 #18
0
        private static void SetupAssemblyReloadEvents()
        {
            // Unity supports recompile/reload settings natively for Unity 2018.2+
            if (UnityUtils.UnityVersion >= new Version(2018, 2))
            {
                return;
            }

            // playmodeStateChanged was marked obsolete in 2017.1. Still working in 2018.3
#pragma warning disable 618
            EditorApplication.playmodeStateChanged += () =>
#pragma warning restore 618
            {
                if (PluginSettings.AssemblyReloadSettings == ScriptCompilationDuringPlay.RecompileAfterFinishedPlaying)
                {
                    MainThreadDispatcher.Instance.Queue(() =>
                    {
                        var newPlayModeState = GetPlayModeState();
                        if (PlayModeSavedState != newPlayModeState)
                        {
                            if (newPlayModeState == PlayModeState.Playing)
                            {
                                ourLogger.Info("LockReloadAssemblies");
                                EditorApplication.LockReloadAssemblies();
                            }
                            else if (newPlayModeState == PlayModeState.Stopped)
                            {
                                ourLogger.Info("UnlockReloadAssemblies");
                                EditorApplication.UnlockReloadAssemblies();
                            }
                            PlayModeSavedState = newPlayModeState;
                        }
                    });
                }
            };

            AppDomain.CurrentDomain.DomainUnload += (sender, args) =>
            {
                if (PluginSettings.AssemblyReloadSettings == ScriptCompilationDuringPlay.StopPlayingAndRecompile)
                {
                    if (EditorApplication.isPlaying)
                    {
                        EditorApplication.isPlaying = false;
                    }
                }
            };
        }
コード例 #19
0
        private void OnUnityPlayModeChanged()
        {
            var changedState = PlayModeState.Stopped;

            switch (_currentState)
            {
            case PlayModeState.Stopped:
                if (EditorApplication.isPlayingOrWillChangePlaymode)
                {
                    changedState = PlayModeState.Playing;
                }
                break;

            case PlayModeState.Playing:
                if (EditorApplication.isPaused)
                {
                    changedState = PlayModeState.Paused;
                }
                else
                {
                    changedState = PlayModeState.Stopped;
                }
                break;

            case PlayModeState.Paused:
                if (EditorApplication.isPlayingOrWillChangePlaymode)
                {
                    changedState = PlayModeState.Playing;
                }
                else
                {
                    changedState = PlayModeState.Stopped;
                }
                break;

            default:
                throw new System.ArgumentOutOfRangeException();
            }

            // Fire PlayModeChanged event.
            OnPlayModeChanged(_currentState, changedState);

            // Set current state.
            _currentState = changedState;
        }
コード例 #20
0
ファイル: BoardEditor.cs プロジェクト: Link2MySoul/ThreeMatch
    public void OnUnityPlayModeChanged()
    {
        var changedState = PlayModeState.Stopped;

        switch (_currentState)
        {
        case PlayModeState.Stopped:
            if (EditorApplication.isPlayingOrWillChangePlaymode)
            {
                changedState = PlayModeState.Playing;
            }
            break;

        case PlayModeState.Playing:
            if (EditorApplication.isPaused)
            {
                changedState = PlayModeState.Paused;
            }
            else
            {
                changedState = PlayModeState.Stopped;
            }
            break;

        case PlayModeState.Paused:
            if (EditorApplication.isPlayingOrWillChangePlaymode)
            {
                changedState = PlayModeState.Playing;
            }
            else
            {
                changedState = PlayModeState.Stopped;
            }
            break;
        }

        _currentState = changedState;

        if (_currentState == PlayModeState.Stopped)
        {
            EditorApplication.OpenScene(PlayerPrefs.GetString("TestScene"));
        }
    }
コード例 #21
0
ファイル: PlayMode.cs プロジェクト: Epiphane/GGJ2016
        private static void OnUnityPlayModeChanged() {

            var changedState = PlayModeState.Stopped;

            int state = GetEditorAppStateBoolComb();

            switch (state) {
                case (22112):
                    changedState = PlayModeState.Playing;
                    break;
                case (21112):
                    changedState = PlayModeState.Paused;
                    break;
                case (22222):
                    changedState = PlayModeState.Stopped;
                    break;
                case (22122):
                    changedState = PlayModeState.AboutToStop;
                    break;
                case (21122):
                    changedState = PlayModeState.AboutToStop;
                    break;
                case (21222):
                    changedState = PlayModeState.Stopped;
                    break;
                case 22212:
                    changedState = PlayModeState.Stopped;
                    break;
                case 21212:
                    changedState = PlayModeState.Paused;
                    break;
                default:
                    // Debug.Log("No such state combination defined: " + state);
                    break;
            }

            // Fire PlayModeChanged event.
            if (_currentState != changedState)
                OnPlayModeChanged(_currentState, changedState);

            // Set current state.
            _currentState = changedState;
        }
コード例 #22
0
    private static void OnPlayModeChanged(PlayModeState currentMode, PlayModeState changedMode)
    {
        // DO your stuff here...
        if (changedMode == PlayModeState.AboutToStop || changedMode == PlayModeState.Stopped)
        {
            TimelineCode.running = false;
        }
        //if (changedMode == PlayModeState.Playing)
        //TimelineCode.running = true;
        TimelineCode.Log(currentMode.ToString() + " => " + changedMode.ToString());

        if (debugOp)
        {
            TimelineCode.Log(EditorApplication.isCompiling);
            TimelineCode.Log(EditorApplication.isPaused);
            TimelineCode.Log(EditorApplication.isPlaying);
            TimelineCode.Log(EditorApplication.isPlayingOrWillChangePlaymode);
            TimelineCode.Log(EditorApplication.isUpdating);
            Debug.LogWarning("-------------------------------------");
        }
    }
コード例 #23
0
        private static void SetupAssemblyReloadEvents()
        {
            // playmodeStateChanged was marked obsolete in 2017.1. Still working in 2018.3
#pragma warning disable 618
            EditorApplication.playmodeStateChanged += () =>
#pragma warning restore 618
            {
                var newPlayModeState = GetPlayModeState();
                if (PlayModeSavedState != newPlayModeState)
                {
                    if (PluginSettings.AssemblyReloadSettings == AssemblyReloadSettings.RecompileAfterFinishedPlaying)
                    {
                        if (newPlayModeState == PlayModeState.Playing)
                        {
                            ourLogger.Info("LockReloadAssemblies");
                            EditorApplication.LockReloadAssemblies();
                        }
                        else if (newPlayModeState == PlayModeState.Stopped)
                        {
                            ourLogger.Info("UnlockReloadAssemblies");
                            EditorApplication.UnlockReloadAssemblies();
                        }
                    }
                    PlayModeSavedState = newPlayModeState;
                }
            };

            AppDomain.CurrentDomain.DomainUnload += (sender, args) =>
            {
                if (PluginSettings.AssemblyReloadSettings == AssemblyReloadSettings.StopPlayingAndRecompile)
                {
                    if (EditorApplication.isPlaying)
                    {
                        EditorApplication.isPlaying = false;
                    }
                }
            };
        }
コード例 #24
0
ファイル: BehaviourWindow.cs プロジェクト: xclouder/godbattle
        /// <summary>
        /// Unity callback called when playmode changes. 
        /// Un-/Registered in the OnDisable/OnEnable. 
        /// Updates the m_PlayModeState member and the activeParent.
        /// Creates or destroy the guiCallback.
        /// </summary>
        void OnPlaymodeChange () {

            // Update playmode
            if (EditorApplication.isPlaying)
                m_PlayModeState = !EditorApplication.isPlayingOrWillChangePlaymode ? PlayModeState.SwitchingToEditor : PlayModeState.Playing;
            else
                m_PlayModeState = EditorApplication.isPlayingOrWillChangePlaymode ? PlayModeState.SwitchingToPlaymode : PlayModeState.Editor;

            // if (/*!EditorApplication.isPaused &&*/ (EditorApplication.isPlayingOrWillChangePlaymode && EditorApplication.isPlaying || !EditorApplication.isPlayingOrWillChangePlaymode && !EditorApplication.isPlaying)) {
            if (m_PlayModeState == PlayModeState.Playing || m_PlayModeState == PlayModeState.Editor) {
                var parentID = m_SerializedParentID;
                activeParent = null;
                activeParent = EditorUtility.InstanceIDToObject(parentID) as ParentBehaviour;
                GUIUtility.hotControl = 0;
                GUIUtility.keyboardControl = 0;
            }

            // Create guiCallback?
            if (m_PlayModeState == PlayModeState.SwitchingToEditor && m_GUICallback == null) {
                m_GUICallback = this.CreateGUICallback();
            }
            // Destroy guiCallback?
            else if (m_PlayModeState == PlayModeState.SwitchingToPlaymode && m_GUICallback != null) {
                DestroyImmediate(m_GUICallback.gameObject, true);
            }
        }
コード例 #25
0
ファイル: BehaviourWindow.cs プロジェクト: xclouder/godbattle
        /// <summary>
        /// A Unity callback called when the window is loaded.
        /// </summary>
        void OnEnable () {
            // Set window name
            this.name = Print.GetLogo() + " Behaviour";
            // Update singleton instance
            Instance = this;

            // Update NotVisible value
            BehaviourWindow.s_NotVisible = this.m_NotVisible;

            // Set playmode state
            if (m_PlayModeState == PlayModeState.Unknow) {
                m_PlayModeState = EditorApplication.isPlaying ? PlayModeState.Playing : PlayModeState.Editor;

                // The guiCallback is null and the unity application is not playing or changing playmode?
                if (m_GUICallback == null && !EditorApplication.isPlayingOrWillChangePlaymode) {
                    // Create game object
                    GameObject go = EditorUtility.CreateGameObjectWithHideFlags("GUI Object", HideFlags.HideAndDontSave, new System.Type[] {typeof(GUICallback)});
                    // Get GUICallback component
                    m_GUICallback = go.GetComponent<GUICallback>();
                }
            }

            // Set callbacks
            activeParentChanged += OnParentSelectionChange;
            activeNodeChanged += OnNodeSelectionChange;
            EditorApplication.playmodeStateChanged += OnPlaymodeChange;
            EditorApplication.delayCall += OnDelayCall;
            LoadSceneUtility.onLoadScene += this.OnLoadScene;
            BehaviourMachinePrefs.preferencesChanged += this.Repaint;

            // The minimum size of this window
            base.minSize = new Vector2(200f, 150f);

            // Forces selection update
            activeParent = EditorUtility.InstanceIDToObject(m_SerializedParentID) as ParentBehaviour;
            OnSelectionChange();
            activeNodeID = m_SerializedNodeID;

            // Set guiController
            SetParentGUI();

            // Automatically repaint window whenever the scene has change
            base.autoRepaintOnSceneChange = true;
        }
コード例 #26
0
 private void OnEnable()
 {
     state = (PlayModeState)EditorPrefs.GetInt("PI.PlayModeState", (int)PlayModeState.EditMode);
 }
コード例 #27
0
 public virtual void OnPlaymodeStateChanged(PlayModeState playModeState)
 {
 }
コード例 #28
0
ファイル: PlayMode.cs プロジェクト: Epiphane/GGJ2016
 static PlayMode() {
     EditorApplication.playmodeStateChanged = OnUnityPlayModeChanged;
     if (EditorApplication.isPaused)
         _currentState = PlayModeState.Paused;
 }
コード例 #29
0
 public override void OnPlaymodeStateChanged(PlayModeState playModeState)
 {
     //Debug.Log ("游戏运行模式发生改变, 点击 运行游戏 或者暂停游戏或者 帧运行游戏 按钮时触发: " + playModeState);
 }
コード例 #30
0
ファイル: PlayMode.cs プロジェクト: Epiphane/GGJ2016
 private static void OnPlayModeChanged(PlayModeState currentState, PlayModeState changedState) {
     if (PlayModeChanged != null)
         PlayModeChanged(currentState, changedState);
 }
コード例 #31
0
        private static void OnUnityPlayModeChanged()
        {
            var changedState = PlayModeState.Stopped;

            //Stoped -> Playing : 22112
            //playing -> abouttostop : 22122
            //about2stop -> stopped : 22222
            //playing -> paused : 21112
            //paused -> playing : 22112
            //paused -> abouttostop : 21122
            //stoped -> paused in editor (stoped) : 21222
            //editor paused - > play(paused) : 21112
            //stoped -> abouttoplay in editor: 22212
            //editor paused -> play : 21212 //paused anyway

            int state = GetEditorAppStateBoolComb();

            switch (state)
            {
            case (22112):
                changedState = PlayModeState.Playing;
                break;

            case (21112):
                changedState = PlayModeState.Paused;
                break;

            case (22222):
                changedState = PlayModeState.Stopped;
                break;

            case (22122):
                changedState = PlayModeState.AboutToStop;
                break;

            case (21122):
                changedState = PlayModeState.AboutToStop;
                break;

            case (21222):
                changedState = PlayModeState.Stopped;
                break;

            case 22212:
                changedState = PlayModeState.Stopped;
                break;

            case 21212:
                changedState = PlayModeState.Paused;
                break;

            default:
                throw new SystemException("No such state combination defined: " + state);
            }

            // Fire PlayModeChanged event.
            if (_currentState != changedState)
            {
                OnPlayModeChanged(_currentState, changedState);
            }

            // Set current state.
            _currentState = changedState;
        }
コード例 #32
0
        private static void OnUnityPlayModeChanged()
        {
            var changedState = PlayModeState.Stopped;

            //Stoped -> Playing : 22112
            //playing -> abouttostop : 22122
            //about2stop -> stopped : 22222
            //playing -> paused : 21112
            //paused -> playing : 22112
            //paused -> abouttostop : 21122
            //stoped -> paused in editor (stoped) : 21222
            //editor paused - > play(paused) : 21112
            //stoped -> abouttoplay in editor: 22212
            //editor paused -> play : 21212 //paused anyway

            int state2 = GetEditorAppStateBoolComb2();

            // Debug.Log("state2:"+state2);
            switch (state2)
            {
            case (6):
                changedState = PlayModeState.Playing;
                break;

            case (14):
            case (10):
                changedState = PlayModeState.Paused;
                break;

            case (0):
            case (2):
            case (8):
                changedState = PlayModeState.Stopped;
                break;

            case (4):
            case (12):
                changedState = PlayModeState.AboutToStop;
                break;
                // default:
                // throw new SystemException("No such state combination defined: " + state2);
            }


            /*
             * int state = GetEditorAppStateBoolComb();
             * Debug.Log("stater:" + state);
             * switch (state) {
             *          case (22112):
             *                  changedState = PlayModeState.Playing;
             *                  break;
             *          case (21112):
             *                  changedState = PlayModeState.Paused;
             *                  break;
             *          case (22222):
             *                  changedState = PlayModeState.Stopped;
             *                  break;
             *          case (22122):
             *                  changedState = PlayModeState.AboutToStop;
             *                  break;
             *          case (21122):
             *                  changedState = PlayModeState.AboutToStop;
             *                  break;
             *          case (21222):
             *                  changedState = PlayModeState.Stopped;
             *                  break;
             *          case 22212:
             *                  changedState = PlayModeState.Stopped;
             *                  break;
             *          case 21212:
             *                  changedState = PlayModeState.Paused;
             *                  break;
             *          default:
             *                  throw new SystemException("No such state combination defined: "+state);
             *          }
             */

            // Fire PlayModeChanged event.
            if (_currentState != changedState)
            {
                OnPlayModeChanged(_currentState, changedState);
            }

            // Set current state.
            _currentState = changedState;
        }