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


C# FlowWindow.GetFunctionContainer方法代码示例

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


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

示例1: GenerateReturnMethod

		public static string GenerateReturnMethod(FlowSystemEditorWindow flowEditor, FlowWindow exitWindow) {
			
			var file = Resources.Load("UI.Windows/Functions/Templates/TemplateReturnMethod") as TextAsset;
			if (file == null) {
				
				Debug.LogError("Functions Template Loading Error: Could not load template 'TemplateReturnMethod'");
				
				return string.Empty;
				
			}
			
			var data = FlowSystem.GetData();
			if (data == null) return string.Empty;
			
			var result = string.Empty;
			var part = file.text;

			var functionContainer = exitWindow.GetFunctionContainer();

			var functionName = functionContainer.title;
			var functionCallName = functionContainer.directory;
			var classNameWithNamespace = Tpl.GetNamespace(exitWindow) + "." + Tpl.GetDerivedClassName(exitWindow);
			
			result +=
				part.Replace("{FUNCTION_NAME}", functionName)
					.Replace("{FUNCTION_CALL_NAME}", functionCallName)
					.Replace("{CLASS_NAME_WITH_NAMESPACE}", classNameWithNamespace);
			
			return result;
			
		}
开发者ID:zhaoluxyz,项目名称:Unity3d.UI.Windows,代码行数:31,代码来源:FunctionsAddon.cs

示例2: DrawWindowToolbar

		private void DrawWindowToolbar(FlowWindow window) {
			
			//var edit = false;
			var id = window.id;

			var buttonStyle = ME.Utilities.CacheStyle("FlowEditor.DrawWindowToolbar.Styles", "toolbarButton", (name) => {

				var _buttonStyle = new GUIStyle(EditorStyles.toolbarButton);
				_buttonStyle.stretchWidth = false;

				return _buttonStyle;

			});

			GUILayout.BeginHorizontal(EditorStyles.toolbar, GUILayout.ExpandWidth(true));
			if (this.waitForAttach == false || this.currentAttachComponent == null) {
				
				if (this.waitForAttach == true) {
					
					if (id != this.currentAttachId) {
						
						var currentAttach = FlowSystem.GetWindow(this.currentAttachId);
						if (currentAttach != null) {
							
							//var attachTo = FlowSystem.GetWindow(id);
							//var hasContainer = currentAttach.HasContainer();
							
							if (currentAttach.IsContainer() == false) {
								
								if (FlowSystem.AlreadyAttached(this.currentAttachId, id) == true) {
									
									if (GUILayout.Button(string.Format("Detach Here{0}", (Event.current.alt == true ? " (Double Direction)" : string.Empty)), buttonStyle) == true) {
										
										FlowSystem.Detach(this.currentAttachId, id, oneWay: Event.current.alt == false);
										if (Event.current.shift == false) this.WaitForAttach(-1);
										
									}
									
								} else {
									
									if (GUILayout.Button(string.Format("Attach Here{0}", (Event.current.alt == true ? " (Double Direction)" : string.Empty)), buttonStyle) == true) {
										
										FlowSystem.Attach(this.currentAttachId, id, oneWay: Event.current.alt == false);
										if (Event.current.shift == false) this.WaitForAttach(-1);
										
									}
									
								}
								
							}
							
						}
						
					} else {
						
						if (GUILayout.Button("Cancel", buttonStyle) == true) {
							
							this.WaitForAttach(-1);
							
						}
						
					}
					
				} else {
					
					if (window.IsSmall() == false ||
					    window.IsFunction() == true) {
						
						if (GUILayout.Button("Attach/Detach", buttonStyle) == true) {
							
							this.ShowNotification(new GUIContent("Use Attach/Detach buttons to Connect/Disconnect a window"));
							this.WaitForAttach(id);
							
						}
						
					}
					
					if (GUILayout.Button("Destroy", buttonStyle) == true) {
						
						if (EditorUtility.DisplayDialog("Are you sure?", "Current window will be destroyed with all links", "Yes, destroy", "No") == true) {
							
							this.ShowNotification(new GUIContent(string.Format("The window `{0}` was successfully destroyed", window.title)));
							FlowSystem.DestroyWindow(id);
							return;
							
						}
						
					}
					
				}
				
				if (window.IsSmall() == false) {
					
					//var isExit = false;
					
					var functionWindow = window.GetFunctionContainer();
					if (functionWindow != null) {
						
						if (functionWindow.functionRootId == 0) functionWindow.functionRootId = id;
						if (functionWindow.functionExitId == 0) functionWindow.functionExitId = id;
//.........这里部分代码省略.........
开发者ID:zhaoluxyz,项目名称:Unity3d.UI.Windows,代码行数:101,代码来源:EditorWindow.cs

示例3: OnCompilerTransitionGeneration

		public override string OnCompilerTransitionGeneration(FlowWindow window) {
			
			var functionContainer = window.GetFunctionContainer();
			if (functionContainer != null) {
				
				var exit = FlowSystem.GetWindow(functionContainer.functionExitId);
				if (exit != null && exit.id == window.id) {
					
					return FlowFunctionsTemplateGenerator.GenerateReturnMethod(this.flowEditor, exit);
					
				}
				
			}

			return base.OnCompilerTransitionGeneration(window);

		}
开发者ID:zhaoluxyz,项目名称:Unity3d.UI.Windows,代码行数:17,代码来源:FunctionsAddon.cs


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