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


C# Data.IsLinker方法代码示例

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


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

示例1: OnCompilerTransitionAttachedGeneration

		/*public override string OnCompilerTransitionGeneration(FD.FlowWindow window) {
			
			return Tpl.GenerateTransitionMethods(window);

		}
		
		public override string OnCompilerTransitionAttachedGeneration(FD.FlowWindow windowFrom, FD.FlowWindow windowTo, bool everyPlatformHasUniqueName) {
			
			if (windowTo.IsFunction() == true && 
			    windowTo.IsSmall() == true &&
			    windowTo.IsContainer() == false &&
			    windowTo.GetFunctionId() > 0) {
				
				return FlowFunctionsTemplateGenerator.GenerateTransitionMethod(this.flowEditor, windowFrom, windowTo);

			}
			
			return base.OnCompilerTransitionAttachedGeneration(windowFrom, windowTo, everyPlatformHasUniqueName);
			
		}*/

		public override string OnCompilerTransitionAttachedGeneration(FD.FlowWindow windowFrom, FD.FlowWindow windowTo, bool everyPlatformHasUniqueName) {
			
			if (windowTo.IsLinker() == true &&
				windowTo.GetLinkerId() > 0) {

				var result = string.Empty;

				var linkerWindow = FlowSystem.GetWindow(windowTo.GetLinkerId());

				var className = linkerWindow.directory;
				var classNameWithNamespace = Tpl.GetNamespace(linkerWindow) + "." + Tpl.GetDerivedClassName(linkerWindow);

				result += TemplateGenerator.GenerateWindowLayoutTransitionMethod(windowTo, linkerWindow, className, classNameWithNamespace);

				WindowSystem.CollectCallVariations(linkerWindow.GetScreen(), (listTypes, listNames) => {

					result += TemplateGenerator.GenerateWindowLayoutTransitionTypedMethod(windowTo, linkerWindow, className, classNameWithNamespace, listTypes, listNames);

				});

				return result;

			}

			return base.OnCompilerTransitionAttachedGeneration(windowFrom, windowTo, everyPlatformHasUniqueName);

		}
开发者ID:puckery,项目名称:Unity3d.UI.Windows,代码行数:48,代码来源:LinkerAddon.cs

示例2: OnFlowWindowGUI

		/*public override string OnCompilerTransitionTypedAttachedGeneration(FD.FlowWindow windowFrom, FD.FlowWindow windowTo, bool everyPlatformHasUniqueName, System.Type[] types, string[] names) {
			
			if (windowTo.IsLinker() == true &&
				windowTo.GetLinkerId() > 0) {

				var result = string.Empty;

				var window = FlowSystem.GetWindow(windowTo.GetLinkerId());

				var className = window.directory;
				var classNameWithNamespace = Tpl.GetNamespace(window) + "." + Tpl.GetDerivedClassName(window);

				result += TemplateGenerator.GenerateWindowLayoutTransitionMethod(windowFrom, window, className, classNameWithNamespace);

				WindowSystem.CollectCallVariations(windowTo.GetScreen(), (listTypes, listNames) => {

					result += TemplateGenerator.GenerateWindowLayoutTransitionTypedMethod(windowFrom, window, className, classNameWithNamespace, listTypes, listNames);

				});

				Debug.Log(className + " :: " + classNameWithNamespace + " == " + result);

				return result;

			}
			
			return base.OnCompilerTransitionTypedAttachedGeneration(windowFrom, windowTo, everyPlatformHasUniqueName, types, names);
			
		}*/

		public override void OnFlowWindowGUI(FD.FlowWindow window) {

			var data = FlowSystem.GetData();
			if (data == null) return;

			var flag =
				(window.IsLinker() == true && 
				 window.IsSmall() == true &&
				 window.IsContainer() == false);

			if (flag == true) {
				
				var alreadyConnectedFunctionIds = new List<int>();

				// Find caller window
				var windowFrom = data.windowAssets.FirstOrDefault((item) => item.HasAttach(window.id));
				if (windowFrom != null) {
					
					var attaches = windowFrom.GetAttachedWindows();
					foreach (var attachWindow in attaches) {
						
						if (attachWindow.IsLinker() == true) {
							
							alreadyConnectedFunctionIds.Add(attachWindow.GetLinkerId());
							
						}
						
					}
					
				}
				
				foreach (var win in data.windowAssets) {

					if (win.CanDirectCall() == true) {

						var count = alreadyConnectedFunctionIds.Count((e) => e == win.id);
						if ((window.GetLinkerId() == win.id && count == 1) || count == 0) {
							
						} else {
							
							if (win.id == window.GetLinkerId()) window.linkerId = 0;
							alreadyConnectedFunctionIds.Remove(win.id);
							
						}

					}

				}

				var linkerId = window.GetLinkerId();
				var linker = linkerId == 0 ? null : data.GetWindow(linkerId);
				var isActiveSelected = true;

				var oldColor = GUI.color;
				GUI.color = isActiveSelected ? Color.white : Color.grey;
				var result = GUILayout.Button(linker != null ? linker.title : "None", FlowSystemEditorWindow.defaultSkin.button, GUILayout.ExpandHeight(true));
				GUI.color = oldColor;
				var rect = GUILayoutUtility.GetLastRect();
				rect.y += rect.height;

				if (result == true) {

					var menu = new GenericMenu();
					menu.AddItem(new GUIContent("None"), window.linkerId == 0, () => {

						window.linkerId = 0;

					});

					if (windowFrom != null) {
//.........这里部分代码省略.........
开发者ID:puckery,项目名称:Unity3d.UI.Windows,代码行数:101,代码来源:LinkerAddon.cs

示例3: IsCompilerTransitionAttachedGeneration

		public override bool IsCompilerTransitionAttachedGeneration(FD.FlowWindow windowFrom, FD.FlowWindow windowTo) {

			return 
				windowTo.IsLinker() == true &&
				windowTo.GetLinkerId() > 0;

		}
开发者ID:puckery,项目名称:Unity3d.UI.Windows,代码行数:7,代码来源:LinkerAddon.cs


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