internal static void OpenAnotherWindow() { RemoteGame remoteGame = ScriptableObject.CreateInstance <RemoteGame>(); ContainerWindow[] windows = ContainerWindow.windows; for (int i = 0; i < windows.Length; i++) { ContainerWindow containerWindow = windows[i]; View[] allChildren = containerWindow.mainView.allChildren; for (int j = 0; j < allChildren.Length; j++) { View view = allChildren[j]; DockArea dockArea = view as DockArea; if (!(dockArea == null)) { if (dockArea.m_Panes.Any((EditorWindow pane) => pane.GetType() == typeof(RemoteGame))) { dockArea.AddTab(remoteGame); break; } } } } remoteGame.Show(); if (EditorApplication.isPlaying) { remoteGame.id = ScriptableSingleton <NScreenManager> .instance.GetNewId(); remoteGame.StartGame(); } }
internal static void OpenAnotherWindow() { RemoteGame instance = ScriptableObject.CreateInstance <RemoteGame>(); foreach (ContainerWindow window in ContainerWindow.windows) { foreach (View allChild in window.mainView.allChildren) { DockArea dockArea = allChild as DockArea; if (!((UnityEngine.Object)dockArea == (UnityEngine.Object)null) && dockArea.m_Panes.Any <EditorWindow>((Func <EditorWindow, bool>)(pane => pane.GetType() == typeof(RemoteGame)))) { dockArea.AddTab((EditorWindow)instance); break; } } } instance.Show(); if (!EditorApplication.isPlaying) { return; } instance.id = ScriptableSingleton <NScreenManager> .instance.GetNewId(); instance.StartGame(); }