Пример #1
0
        private static void Play()
        {
            GameWindow  gameWindow  = GetWindow <GameWindow>();
            SceneWindow sceneWindow = GetWindow <SceneWindow>();

            PlayInEditorState state = PlayInEditor.State;

            if (state != PlayInEditorState.Playing)
            {
                gameWindow.Active   = true;
                gameWindow.HasFocus = true;
            }
            else
            {
                sceneWindow.Active   = true;
                sceneWindow.HasFocus = true;
            }

            if (state == PlayInEditorState.Paused)
            {
                PlayInEditor.State = PlayInEditorState.Playing;
            }
            else
            {
                if (state == PlayInEditorState.Playing)
                {
                    PlayInEditor.State = PlayInEditorState.Stopped;
                }
                else
                {
                    PlayInEditor.State = PlayInEditorState.Playing;
                }
            }
        }
 private static extern void Internal_setState(PlayInEditorState state);