TryOpenMapMagicBiome() 개인적인 메소드

private TryOpenMapMagicBiome ( Graph graph ) : bool
graph Graph
리턴 bool
예제 #1
0
파일: GraphWindow.cs 프로젝트: AJ213/Awitu
			public static GraphWindow Show (Graph graph)
			{
				GraphWindow window = null;
				GraphWindow[] allWindows = Resources.FindObjectsOfTypeAll<GraphWindow>();

				//if opened as biome via focused graph window - opening as biome
				if (focusedWindow is GraphWindow focWin  &&  focWin.graph.ContainsSubGraph(graph))
				{
					focWin.OpenBiome(graph);
					return focWin;
				}

				//if opened only one window - using it (and trying to load mm biomes)
				if (window == null)
				{
					if (allWindows.Length == 1)  
					{
						window = allWindows[0];
						if (!window.TryOpenMapMagicBiome(graph))
							window.OpenRoot(graph);
					}
				}

				//if window with this graph currently opened - just focusing it
				if (window == null)
				{
					for (int w=0; w<allWindows.Length; w++)
						if (allWindows[w].graph == graph)
							window = allWindows[w];
				}

				//if the window with parent graph currently opened
				if (window == null)
				{
					for (int w=0; w<allWindows.Length; w++)
						if (allWindows[w].graph.ContainsSubGraph(graph))
						{
							window = allWindows[w];
							window.OpenBiome(graph);
						}
				}

				//if no window found after all - creating new tab (and trying to load mm biomes)
				if (window == null)
				{
					window = CreateInstance<GraphWindow>();
					if (!window.TryOpenMapMagicBiome(graph))
						window.OpenRoot(graph);
				}
					
				ShowWindow(window, inTab:false);
				return window;
			}