static internal void InitPlaymodeLayout()
        {
            m_PlayModeView = WindowLayout.ShowAppropriateViewOnEnterExitPlaymode(true) as PlayModeView;
            if (m_PlayModeView == null)
            {
                return;
            }

            DockArea da = m_PlayModeView.m_Parent as DockArea;

            if (da != null)
            {
                if (m_PlayModeView.maximizeOnPlay)
                {
                    m_MaximizePending = WindowLayout.MaximizePrepare(da.actualView);
                }

                var gv = da.actualView as GameView;
                if (gv != null)
                {
                    m_PlayModeView.m_Parent.EnableVSync(gv.vSyncEnabled);
                }
            }

            // Mark this PlayModeView window as the start view so the backend
            // can set size and mouseoffset properly for this view
            m_PlayModeView.m_Parent.SetAsStartView();
            m_PlayModeView.m_Parent.SetAsLastPlayModeView();

            Toolbar.RepaintToolbar();
        }
Exemple #2
0
        static internal void InitPlaymodeLayout()
        {
            m_PreviewWindow = WindowLayout.ShowAppropriateViewOnEnterExitPlaymode(true) as PreviewEditorWindow;
            if (m_PreviewWindow == null)
            {
                return;
            }

            if (m_PreviewWindow.maximizeOnPlay)
            {
                DockArea da = m_PreviewWindow.m_Parent as DockArea;

                if (da != null)
                {
                    m_MaximizePending = WindowLayout.MaximizePrepare(da.actualView);
                }
            }

            // Mark this preview window as the start preview so the backend
            // can set size and mouseoffset properly for this preview
            m_PreviewWindow.m_Parent.SetAsStartView();
            m_PreviewWindow.m_Parent.SetAsLastPlayModeView();

            Toolbar.RepaintToolbar();
        }
        public static void Maximize(EditorWindow win)
        {
            bool flag = WindowLayout.MaximizePrepare(win);

            if (flag)
            {
                WindowLayout.MaximizePresent(win);
            }
        }
        public static void Maximize(EditorWindow win)
        {
            View view = WindowLayout.MaximizePrepare(win);

            if (view)
            {
                WindowLayout.MaximizePresent(win, view);
            }
        }
Exemple #5
0
        public static void Maximize(EditorWindow win)
        {
            View rootSplit = WindowLayout.MaximizePrepare(win);

            if (!(bool)((UnityEngine.Object)rootSplit))
            {
                return;
            }
            WindowLayout.MaximizePresent(win, rootSplit);
        }
Exemple #6
0
 internal static void InitPlaymodeLayout()
 {
     m_GameView = WindowLayout.ShowAppropriateViewOnEnterExitPlaymode(true) as GameView;
     if (m_GameView != null)
     {
         if (m_GameView.maximizeOnPlay)
         {
             DockArea parent = m_GameView.m_Parent as DockArea;
             if ((parent != null) && !parent.actualView.m_Parent.window.maximized)
             {
                 m_MaximizePending = WindowLayout.MaximizePrepare(parent.actualView);
             }
         }
         m_GameView.m_Parent.SetAsStartView();
         Toolbar.RepaintToolbar();
     }
 }
Exemple #7
0
 internal static void InitPlaymodeLayout()
 {
     EditorApplicationLayout.m_GameView = (WindowLayout.ShowAppropriateViewOnEnterExitPlaymode(true) as GameView);
     if (!(EditorApplicationLayout.m_GameView == null))
     {
         if (EditorApplicationLayout.m_GameView.maximizeOnPlay)
         {
             DockArea dockArea = EditorApplicationLayout.m_GameView.m_Parent as DockArea;
             if (dockArea != null)
             {
                 EditorApplicationLayout.m_MaximizePending = WindowLayout.MaximizePrepare(dockArea.actualView);
             }
         }
         EditorApplicationLayout.m_GameView.m_Parent.SetAsStartView();
         Toolbar.RepaintToolbar();
     }
 }
Exemple #8
0
 internal static void InitPlaymodeLayout()
 {
     EditorApplicationLayout.m_GameView = WindowLayout.ShowAppropriateViewOnEnterExitPlaymode(true) as GameView;
     if ((Object)EditorApplicationLayout.m_GameView == (Object)null)
     {
         return;
     }
     if (EditorApplicationLayout.m_GameView.maximizeOnPlay)
     {
         DockArea parent = EditorApplicationLayout.m_GameView.m_Parent as DockArea;
         if ((Object)parent != (Object)null && !parent.actualView.m_Parent.window.maximized)
         {
             EditorApplicationLayout.m_RootSplit = WindowLayout.MaximizePrepare(parent.actualView);
         }
     }
     EditorApplicationLayout.m_GameView.m_Parent.SetAsStartView();
     Toolbar.RepaintToolbar();
 }
Exemple #9
0
 internal static void InitPlaymodeLayout()
 {
     EditorApplicationLayout.m_GameView = (WindowLayout.ShowAppropriateViewOnEnterExitPlaymode(true) as GameView);
     if (EditorApplicationLayout.m_GameView == null)
     {
         return;
     }
     if (EditorApplicationLayout.m_GameView.maximizeOnPlay)
     {
         DockArea dockArea = EditorApplicationLayout.m_GameView.m_Parent as DockArea;
         if (dockArea != null)
         {
             ContainerWindow window = dockArea.actualView.m_Parent.window;
             if (!window.maximized)
             {
                 EditorApplicationLayout.m_RootSplit = WindowLayout.MaximizePrepare(dockArea.actualView);
             }
         }
     }
     EditorApplicationLayout.m_GameView.m_Parent.SetAsStartView();
     Toolbar.RepaintToolbar();
 }
        static internal void InitPlaymodeLayout()
        {
            InitializePlaymodeViewList();
            WindowLayout.ShowAppropriateViewOnEnterExitPlaymodeList(true, out m_PlayModeViewList);

            var fullscreenDetected = false;
            var monitorNames       = EditorFullscreenController.GetConnectedDisplayNames();

            foreach (var playModeView in m_PlayModeViewList)
            {
                if (playModeView == null)
                {
                    continue;
                }

                if (playModeView.fullscreenMonitorIdx >= monitorNames.Length)
                {
                    continue;
                }

                if (playModeView.enterPlayModeBehavior == PlayModeView.EnterPlayModeBehavior.PlayFullscreen)
                {
                    EditorFullscreenController.SetSettingsForCurrentDisplay(playModeView.fullscreenMonitorIdx);
                    EditorFullscreenController.isFullscreenOnPlay           = true;
                    EditorFullscreenController.fullscreenDisplayId          = playModeView.fullscreenMonitorIdx;
                    EditorFullscreenController.isToolbarEnabledOnFullscreen = false;
                    EditorFullscreenController.targetDisplayID = playModeView.targetDisplay;

                    if (playModeView.m_Parent is DockArea dockArea && dockArea.actualView is GameView gv)
                    {
                        playModeView.m_Parent.EnableVSync(gv.vSyncEnabled);
                        EditorFullscreenController.enableVSync       = gv.vSyncEnabled;
                        EditorFullscreenController.selectedSizeIndex = gv.selectedSizeIndex;
                    }
                    fullscreenDetected = true;
                }
                else if (!fullscreenDetected)
                {
                    EditorFullscreenController.isFullscreenOnPlay = false;
                }

                if (playModeView.enterPlayModeBehavior == PlayModeView.EnterPlayModeBehavior.PlayMaximized)
                {
                    if (playModeView.m_Parent is DockArea dockArea)
                    {
                        m_MaximizePending = WindowLayout.MaximizePrepare(dockArea.actualView);
                        var gv = dockArea.actualView as GameView;
                        if (gv != null)
                        {
                            playModeView.m_Parent.EnableVSync(gv.vSyncEnabled);
                        }
                    }
                }

                EditorFullscreenController.OnEnterPlaymode();

                if (!EditorFullscreenController.isFullscreenOnPlay)
                {
                    playModeView.m_Parent.SetAsStartView();
                    playModeView.m_Parent.SetAsLastPlayModeView();

                    if (playModeView.maximized)
                    {
                        playModeView.m_Parent.Focus();
                    }

                    if (playModeView is IGameViewOnPlayMenuUser)
                    {
                        if (((IGameViewOnPlayMenuUser)playModeView).playFocused)
                        {
                            playModeView.m_Parent.Focus();
                        }
                    }
                }
                Toolbar.RepaintToolbar();
            }
        }