当前位置: 首页>>代码示例>>C#>>正文


C# FlowWindow.SetCompletedState方法代码示例

本文整理汇总了C#中UnityEngine.UI.Windows.Plugins.Flow.FlowWindow.SetCompletedState方法的典型用法代码示例。如果您正苦于以下问题:C# FlowWindow.SetCompletedState方法的具体用法?C# FlowWindow.SetCompletedState怎么用?C# FlowWindow.SetCompletedState使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在UnityEngine.UI.Windows.Plugins.Flow.FlowWindow的用法示例。


在下文中一共展示了FlowWindow.SetCompletedState方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: SelectWindow

		private void SelectWindow(FlowWindow window) {
			
			for (int i = 0; i < window.states.Length; ++i) window.SetCompletedState(i, CompletedState.NotReady);
			
			if (window.compiled == false) {
				
				this.ShowNotification(new GUIContent("You need to compile this window to use `Select` command"));
				
			} else {

				if (Directory.Exists(window.compiledDirectory) == false) {

					window.compiledDirectory = Path.GetDirectoryName(AssetDatabase.GetAssetPath(FlowSystem.GetData())) + "/" + window.compiledNamespace.Replace(FlowSystem.GetData().namespaceName, string.Empty) + "/" + window.compiledNamespace.Replace(".", "/");

				}

				Selection.activeObject = AssetDatabase.LoadAssetAtPath(window.compiledDirectory.Trim('/'), typeof(Object));
				EditorGUIUtility.PingObject(Selection.activeObject);
				
				//if (window.screen == null) {
				
				window.SetCompletedState(0, CompletedState.NotReady);
				
				var files = AssetDatabase.FindAssets("t:GameObject", new string[] { window.compiledDirectory.Trim('/') + "/Screens" });
				foreach (var file in files) {
					
					var path = AssetDatabase.GUIDToAssetPath(file);
					
					var go = AssetDatabase.LoadAssetAtPath(path, typeof(GameObject)) as GameObject;
					if (go != null) {
						
						var screen = go.GetComponent<WindowBase>();
						if (screen != null) {
							
							window.SetScreen(screen);
							window.SetCompletedState(0, CompletedState.Ready);
							
							var lWin = screen as LayoutWindowType;
							if (lWin != null) {
								
								if (lWin.layout.layout != null) {
									
									window.SetCompletedState(1, CompletedState.Ready);
									window.SetCompletedState(2, (lWin.layout.components.Any((c) => c.component == null) == true) ? CompletedState.ReadyButWarnings : CompletedState.Ready);
									
								} else {
									
									window.SetCompletedState(0, CompletedState.NotReady);
									window.SetCompletedState(1, CompletedState.NotReady);
									window.SetCompletedState(2, CompletedState.NotReady);
									
								}
								
							} else {
								
								window.SetCompletedState(1, CompletedState.Ready);
								
							}
							
							break;
							
						} else {
							
							window.SetCompletedState(0, CompletedState.ReadyButWarnings);
							
						}
						
					}
					
				}
				
				//}
				
			}
			
		}
开发者ID:zhaoluxyz,项目名称:Unity3d.UI.Windows,代码行数:76,代码来源:EditorWindow.cs


注:本文中的UnityEngine.UI.Windows.Plugins.Flow.FlowWindow.SetCompletedState方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。