internal static EditorWindow TryFocusAppropriateWindow(bool enteringPlaymode) { EditorWindow result; if (enteringPlaymode) { GameView gameView = (GameView)WindowLayout.FindEditorWindowOfType(typeof(GameView)); if (gameView) { WindowLayout.SaveCurrentFocusedWindowInSameDock(gameView); gameView.Focus(); } result = gameView; } else { EditorWindow editorWindow = WindowLayout.TryGetLastFocusedWindowInSameDock(); if (editorWindow) { editorWindow.ShowTab(); } result = editorWindow; } return(result); }
internal static EditorWindow TryGetLastFocusedWindowInSameDock() { Type type = null; string lastWindowTypeInSameDock = WindowFocusState.instance.m_LastWindowTypeInSameDock; if (lastWindowTypeInSameDock != "") { type = Type.GetType(lastWindowTypeInSameDock); } GameView gameView = WindowLayout.FindEditorWindowOfType(typeof(GameView)) as GameView; EditorWindow result; if (type != null && gameView && gameView.m_Parent != null && gameView.m_Parent is DockArea) { object[] array = Resources.FindObjectsOfTypeAll(type); DockArea y = gameView.m_Parent as DockArea; for (int i = 0; i < array.Length; i++) { EditorWindow editorWindow = array[i] as EditorWindow; if (editorWindow && editorWindow.m_Parent == y) { result = editorWindow; return(result); } } } result = null; return(result); }
private void ClickEnableFrameDebugger() { bool flag = FrameDebuggerUtility.IsLocalEnabled() || FrameDebuggerUtility.IsRemoteEnabled(); bool flag2 = !flag && this.m_AttachProfilerUI.IsEditor(); if (!flag2 || FrameDebuggerUtility.locallySupported) { if (flag2) { if (EditorApplication.isPlaying && !EditorApplication.isPaused) { EditorApplication.isPaused = true; } } if (!flag) { FrameDebuggerUtility.SetEnabled(true, ProfilerDriver.connectedProfiler); } else { FrameDebuggerUtility.SetEnabled(false, FrameDebuggerUtility.GetRemotePlayerGUID()); } if (FrameDebuggerUtility.IsLocalEnabled()) { GameView gameView = (GameView)WindowLayout.FindEditorWindowOfType(typeof(GameView)); if (gameView) { gameView.ShowTab(); } } this.m_PrevEventsLimit = FrameDebuggerUtility.limit; this.m_PrevEventsCount = FrameDebuggerUtility.count; } }
internal static EditorWindow TryGetLastFocusedWindowInSameDock() { System.Type type = (System.Type)null; string windowTypeInSameDock = WindowFocusState.instance.m_LastWindowTypeInSameDock; if (windowTypeInSameDock != string.Empty) { type = System.Type.GetType(windowTypeInSameDock); } GameView editorWindowOfType = WindowLayout.FindEditorWindowOfType(typeof(GameView)) as GameView; if (type != null && (bool)((UnityEngine.Object)editorWindowOfType) && ((UnityEngine.Object)editorWindowOfType.m_Parent != (UnityEngine.Object)null && editorWindowOfType.m_Parent is DockArea)) { object[] objectsOfTypeAll = (object[])Resources.FindObjectsOfTypeAll(type); DockArea parent = editorWindowOfType.m_Parent as DockArea; for (int index = 0; index < objectsOfTypeAll.Length; ++index) { EditorWindow editorWindow = objectsOfTypeAll[index] as EditorWindow; if ((bool)((UnityEngine.Object)editorWindow) && (UnityEngine.Object)editorWindow.m_Parent == (UnityEngine.Object)parent) { return(editorWindow); } } } return((EditorWindow)null); }
internal static void FindFirstGameViewAndSetToMaximizeOnPlay() { GameView gameView = (GameView)WindowLayout.FindEditorWindowOfType(typeof(GameView)); if (gameView) { gameView.maximizeOnPlay = true; } }
void AfterAssemblyReload() { var selector = (ObjectSelector)WindowLayout.FindEditorWindowOfType(typeof(ObjectSelector)); if (selector != null && selector.hasFocus) { selector.Close(); } }
internal static EditorWindow ShowAppropriateViewOnEnterExitPlaymode(bool entering) { if (WindowFocusState.instance.m_CurrentlyInPlayMode == entering) { return(null); } WindowFocusState.instance.m_CurrentlyInPlayMode = entering; EditorWindow maximizedWindow = WindowLayout.GetMaximizedWindow(); if (entering) { WindowFocusState.instance.m_WasMaximizedBeforePlay = (maximizedWindow != null); if (maximizedWindow != null) { return(maximizedWindow); } } else { if (WindowFocusState.instance.m_WasMaximizedBeforePlay) { return(maximizedWindow); } } if (maximizedWindow) { WindowLayout.Unmaximize(maximizedWindow); } EditorWindow editorWindow = WindowLayout.TryFocusAppropriateWindow(entering); if (editorWindow) { return(editorWindow); } if (entering) { EditorWindow editorWindow2 = WindowLayout.FindEditorWindowOfType(typeof(SceneView)); GameView gameView; if (editorWindow2 && editorWindow2.m_Parent is DockArea) { DockArea dockArea = editorWindow2.m_Parent as DockArea; if (dockArea) { WindowFocusState.instance.m_LastWindowTypeInSameDock = editorWindow2.GetType().ToString(); gameView = ScriptableObject.CreateInstance <GameView>(); dockArea.AddTab(gameView); return(gameView); } } gameView = ScriptableObject.CreateInstance <GameView>(); gameView.Show(true); gameView.Focus(); return(gameView); } return(editorWindow); }
private void UpdateViews() { AudioMixerWindow audioMixerWindow = (AudioMixerWindow)WindowLayout.FindEditorWindowOfType(typeof(AudioMixerWindow)); if (audioMixerWindow != null) { audioMixerWindow.Repaint(); } InspectorWindow.RepaintAllInspectors(); }
private void UpdateViews() { AudioMixerWindow editorWindowOfType = (AudioMixerWindow)WindowLayout.FindEditorWindowOfType(typeof(AudioMixerWindow)); if ((UnityEngine.Object)editorWindowOfType != (UnityEngine.Object)null) { editorWindowOfType.Repaint(); } InspectorWindow.RepaintAllInspectors(); }
internal static void FindFirstGameViewAndSetToMaximizeOnPlay() { GameView editorWindowOfType = (GameView)WindowLayout.FindEditorWindowOfType(typeof(GameView)); if (!(bool)((UnityEngine.Object)editorWindowOfType)) { return; } editorWindowOfType.maximizeOnPlay = true; }
internal static EditorWindow ShowAppropriateViewOnEnterExitPlaymode(bool entering) { if (WindowFocusState.instance.m_CurrentlyInPlayMode == entering) { return((EditorWindow)null); } WindowFocusState.instance.m_CurrentlyInPlayMode = entering; EditorWindow maximizedWindow = WindowLayout.GetMaximizedWindow(); if (entering) { WindowFocusState.instance.m_WasMaximizedBeforePlay = (UnityEngine.Object)maximizedWindow != (UnityEngine.Object)null; if ((UnityEngine.Object)maximizedWindow != (UnityEngine.Object)null) { return(maximizedWindow); } } else if (WindowFocusState.instance.m_WasMaximizedBeforePlay) { return(maximizedWindow); } if ((bool)((UnityEngine.Object)maximizedWindow)) { WindowLayout.Unmaximize(maximizedWindow); } EditorWindow editorWindow = WindowLayout.TryFocusAppropriateWindow(entering); if ((bool)((UnityEngine.Object)editorWindow) || !entering) { return(editorWindow); } EditorWindow editorWindowOfType = WindowLayout.FindEditorWindowOfType(typeof(SceneView)); if ((bool)((UnityEngine.Object)editorWindowOfType) && editorWindowOfType.m_Parent is DockArea) { DockArea parent = editorWindowOfType.m_Parent as DockArea; if ((bool)((UnityEngine.Object)parent)) { WindowFocusState.instance.m_LastWindowTypeInSameDock = editorWindowOfType.GetType().ToString(); GameView instance = ScriptableObject.CreateInstance <GameView>(); parent.AddTab((EditorWindow)instance); return((EditorWindow)instance); } } GameView instance1 = ScriptableObject.CreateInstance <GameView>(); instance1.Show(true); instance1.Focus(); return((EditorWindow)instance1); }
internal static EditorWindow TryFocusAppropriateWindow(bool enteringPlaymode) { if (enteringPlaymode) { GameView editorWindowOfType = (GameView)WindowLayout.FindEditorWindowOfType(typeof(GameView)); if ((bool)((UnityEngine.Object)editorWindowOfType)) { WindowLayout.SaveCurrentFocusedWindowInSameDock((EditorWindow)editorWindowOfType); editorWindowOfType.Focus(); } return((EditorWindow)editorWindowOfType); } EditorWindow windowInSameDock = WindowLayout.TryGetLastFocusedWindowInSameDock(); if ((bool)((UnityEngine.Object)windowInSameDock)) { windowInSameDock.ShowTab(); } return(windowInSameDock); }
private void ClickEnableFrameDebugger() { if (GraphicsSupportsFrameDebugger()) { if ((!FrameDebuggerUtility.enabled && EditorApplication.isPlaying) && !EditorApplication.isPaused) { EditorApplication.isPaused = true; } FrameDebuggerUtility.enabled = !FrameDebuggerUtility.enabled; if (FrameDebuggerUtility.enabled) { GameView view = (GameView)WindowLayout.FindEditorWindowOfType(typeof(GameView)); if (view != null) { view.ShowTab(); } } this.m_PrevEventsLimit = FrameDebuggerUtility.limit; this.m_PrevEventsCount = FrameDebuggerUtility.count; } }