• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# Flow.FlowWindow类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



FlowWindow类属于UnityEngine.UI.Windows.Plugins.Flow命名空间,在下文中一共展示了FlowWindow类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: Get

			public Window Get(FlowWindow window) {

				Window result = null;
				
				this.list.RemoveAll((info) => {
					
					var w = Flow.FlowSystem.GetWindow(info.id);
					return w == null || w.IsSocial() == false;
					
				});

				if (window.IsSocial() == false) return result;

				foreach (var item in this.list) {

					if (item.id == window.id) {

						result = item;
						break;

					}

				}

				if (result == null) {

					result = new Window(window);
					this.list.Add(result);

				}

				return result;

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


示例2: OnFlowWindowGUI

		public override void OnFlowWindowGUI(FlowWindow window) {

			if (window.CanCompiled() == false) return;

			if (string.IsNullOrEmpty(window.compiledDirectory) == false) {
				
				window.compiled = System.IO.File.Exists(window.compiledDirectory + "/" + window.compiledBaseClassName + ".cs");
				
			}
			
			var oldColor = GUI.color;
			var style = new GUIStyle("U2D.dragDotDimmed");
			var styleCompiled = new GUIStyle("U2D.dragDot");
			
			var elemWidth = style.fixedWidth - 3f;
			
			var posY = -1f;
			var posX = -1f;
			
			GUI.color = window.compiled ? Color.white : Color.red;
			GUI.Label(new Rect(posX, posY, elemWidth, style.fixedHeight), new GUIContent(string.Empty, window.compiled ? "Compiled" : "Not compiled"), window.compiled ? styleCompiled : style);
			
			GUI.color = oldColor;
			
		}
开发者ID:zhaoluxyz,项目名称:Unity3d.UI.Windows,代码行数:25,代码来源:FlowCompilerAddon.cs


示例3: 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


示例4: Info

			public Info(FlowWindow window) {
				
				this.baseNamespace = window.compiledNamespace;
				this.classname = window.compiledDerivedClassName;
				this.baseClassname = window.compiledBaseClassName;
				this.screenName = window.directory;

			}
开发者ID:Trithilon,项目名称:Unity3d.UI.Windows,代码行数:8,代码来源:FlowCompilerSystem.cs


示例5: GenerateTransitionMethod

		public static string GenerateTransitionMethod(FlowSystemEditorWindow flowEditor, FlowWindow windowFrom, FlowWindow windowTo) {
			
			var file = Resources.Load("UI.Windows/Functions/Templates/TemplateTransitionMethod") as TextAsset;
			if (file == null) {
				
				Debug.LogError("Functions Template Loading Error: Could not load template 'TemplateTransitionMethod'");
				
				return string.Empty;
				
			}
			
			var data = FlowSystem.GetData();
			if (data == null) return string.Empty;
			
			var result = string.Empty;
			var part = file.text;
			
			// Function link
			var functionId = windowTo.GetFunctionId();
			
			// Find function container
			var functionContainer = data.GetWindow(functionId);
			if (functionContainer == null) {
				
				// Function not found
				return string.Empty;
				
			}
			
			// Get function root window
			var root = data.GetWindow(functionContainer.functionRootId);
			//var exit = data.GetWindow(functionContainer.functionExitId);
			
			var functionName = functionContainer.title;
			var functionCallName = functionContainer.directory;
			var classNameWithNamespace = Tpl.GetNamespace(root) + "." + Tpl.GetDerivedClassName(root);
			var transitionMethods = Tpl.GenerateTransitionMethods(windowTo);
			transitionMethods = transitionMethods.Replace("\r\n", "\r\n\t")
												 .Replace("\n", "\n\t");

			result +=
				part.Replace("{TRANSITION_METHODS}", transitionMethods)
					.Replace("{FUNCTION_NAME}", functionName)
					.Replace("{FUNCTION_CALL_NAME}", functionCallName)
					.Replace("{FLOW_FROM_ID}", windowFrom.id.ToString())
					.Replace("{FLOW_TO_ID}", windowTo.id.ToString())
					.Replace("{CLASS_NAME_WITH_NAMESPACE}", classNameWithNamespace);
			
			return result;
			
		}
开发者ID:zhaoluxyz,项目名称:Unity3d.UI.Windows,代码行数:51,代码来源:FunctionsAddon.cs


示例6: DrawComponentCurve

		public void DrawComponentCurve(FlowWindow from, ref UnityEngine.UI.Windows.Plugins.Flow.FlowWindow.ComponentLink link, FlowWindow to) {

			if (from.IsEnabled() == false || to.IsEnabled() == false) return;
			
			var component = from.GetLayoutComponent(link.sourceComponentTag);
			if (component != null) {
				
				var rect = component.tempEditorRect;
				
				var start = new Rect(from.rect.x + rect.x, from.rect.y + rect.y, rect.width, rect.height);
				var end = to.rect;
				
				var zOffset = -4f;
				
				var offset = Vector2.zero;
				var startPos = new Vector3(start.center.x + offset.x, start.center.y + offset.y, zOffset);
				var endPos = new Vector3(end.center.x + offset.x, end.center.y + offset.y, zOffset);
				
				var scale = FlowSystem.GetData().flowWindowWithLayoutScaleFactor;
				
				var side1 = from.rect.size.x * 0.5f;
				var side2 = from.rect.size.y * 0.5f;
				var stopDistance = Mathf.Sqrt(side1 * side1 + side2 * side2);
				
				var color = Color.white;
				if (from.GetContainer() != to.GetContainer()) {
					
					color = Color.gray;
					if (to.GetContainer() != null) color = to.GetContainer().randomColor;
					
				}
				var comment = this.DrawComponentCurve(startPos, endPos, color, stopDistance + 50f * scale, link.comment);
				if (link.comment != comment) {
					
					link.comment = comment;
					FlowSystem.SetDirty();
					
				}
				
			}
			
		}
开发者ID:bartez,项目名称:Unity3d.UI.Windows,代码行数:42,代码来源:GUIDrawer.cs


示例7: DrawStates

		private void DrawStates(CompletedState[] states, FlowWindow window) {
			
			if (states == null) return;
			
			var oldColor = GUI.color;
			var style = ME.Utilities.CacheStyle("FlowEditor.DrawStates.Styles", "Grad Down Swatch");
			
			var elemWidth = style.fixedWidth - 3f;
			var width = window.rect.width - 6f;
			
			var posY = -9f;
			
			var color = Color.black;
			color.a = 0.6f;
			var posX = width - elemWidth;
			
			var shadowOffset = 1f;
			for (int i = states.Length - 1; i >= 0; --i) {
				
				GUI.color = color;
				GUI.Label(new Rect(posX + shadowOffset, posY + shadowOffset, elemWidth, style.fixedHeight), string.Empty, style);
				posX -= elemWidth;
				
			}
			
			posX = width - elemWidth;
			for (int i = states.Length - 1; i >= 0; --i) {
				
				var state = states[i];
				
				if (state == CompletedState.NotReady) {
					
					color = new Color(1f, 0.3f, 0.3f, 1f);
					
				} else if (state == CompletedState.Ready) {
					
					color = new Color(0.3f, 1f, 0.3f, 1f);
					
				} else if (state == CompletedState.ReadyButWarnings) {
					
					color = new Color(1f, 1f, 0.3f, 1f);
					
				}
				
				GUI.color = color;
				GUI.Label(new Rect(posX, posY, elemWidth, style.fixedHeight), string.Empty, style);
				posX -= elemWidth;
				
			}
			
			GUI.color = oldColor;
			
		}
开发者ID:zhaoluxyz,项目名称:Unity3d.UI.Windows,代码行数:53,代码来源:EditorWindow.cs


示例8: GetTagsHeight

		public float GetTagsHeight(FlowWindow window) {
			
			var columns = 3;
			var height = 16f;

			return Mathf.CeilToInt(window.tags.Count / (float)columns) * height + height + 2f;

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


示例9: DrawTags

		private void DrawTags(FlowWindow window, bool defaultWindow = false) {

			EditorGUIUtility.labelWidth = 35f;
			
			var tagStyles = FlowSystemEditor.GetTagStyles();

			var tagCaptionStyleText = ME.Utilities.CacheStyle("FlowEditor.DrawTags.Styles", "sv_label_0");

			var tagCaptionStyle = ME.Utilities.CacheStyle("FlowEditor.DrawTags.Styles", "tagCaptionStyle", (styleName) => {

				var _tagCaptionStyle = new GUIStyle(GUI.skin.textField);
				_tagCaptionStyle.alignment = TextAnchor.MiddleCenter;
				_tagCaptionStyle.fixedWidth = 90f;
				_tagCaptionStyle.fixedHeight = tagCaptionStyleText.fixedHeight;
				_tagCaptionStyle.stretchWidth = false;
				_tagCaptionStyle.font = tagCaptionStyleText.font;
				_tagCaptionStyle.fontStyle = tagCaptionStyleText.fontStyle;
				_tagCaptionStyle.fontSize = tagCaptionStyleText.fontSize;
				_tagCaptionStyle.normal = tagCaptionStyleText.normal;
				_tagCaptionStyle.focused = tagCaptionStyleText.normal;
				_tagCaptionStyle.active = tagCaptionStyleText.normal;
				_tagCaptionStyle.hover = tagCaptionStyleText.normal;
				_tagCaptionStyle.border = tagCaptionStyleText.border;
				//_tagCaptionStyle.padding = tagCaptionStyleText.padding;
				//_tagCaptionStyle.margin = tagCaptionStyleText.margin;
				_tagCaptionStyle.margin = new RectOffset();

				return _tagCaptionStyle;

			});
			
			var tagStyleAdd = ME.Utilities.CacheStyle("FlowEditor.DrawTags.Styles", "sv_label_3", (styleName) => {
				
				var _tagStyleAdd = new GUIStyle(styleName);
				_tagStyleAdd.margin = new RectOffset(0, 0, 0, 0);
				_tagStyleAdd.padding = new RectOffset(3, 5, 0, 2);
				_tagStyleAdd.alignment = TextAnchor.MiddleCenter;
				_tagStyleAdd.stretchWidth = false;

				return _tagStyleAdd;

			});

			var tagsLabel = ME.Utilities.CacheStyle("FlowEditor.DrawTags.Styles", "defaultLabel", (styleName) => {
				
				var _tagsLabel = new GUIStyle(FlowSystemEditorWindow.defaultSkin.label);
				_tagsLabel.padding = new RectOffset(_tagsLabel.padding.left, _tagsLabel.padding.right, _tagsLabel.padding.top, _tagsLabel.padding.bottom + 4);

				return _tagsLabel;

			});

			var changed = false;
			
			GUILayout.BeginHorizontal();
			{
				GUILayoutExt.LabelWithShadow("Tags:", tagsLabel, GUILayout.Width(EditorGUIUtility.labelWidth));
				
				GUILayout.BeginVertical();
				{
					GUILayout.Space(4f);
					
					var tagCaption = string.Empty;
					if (this.showTagsPopupId == window.id) tagCaption = this.tagCaption;
					
					var isEnter = (Event.current.type == EventType.keyDown && Event.current.keyCode == KeyCode.Return);
					
					GUILayout.BeginVertical();
					{
						
						GUILayout.BeginHorizontal();
						{
							
							var columns = 3;
							var i = 0;
							foreach (var tag in window.tags) {
								
								if (i % columns == 0) {
									
									GUILayout.EndHorizontal();
									GUILayout.BeginHorizontal();
									
								}
								
								var tagInfo = FlowSystem.GetData().GetTag(tag);
								if (tagInfo == null) {
									
									window.tags.Remove(tag);
									break;
									
								}
								
								if (GUILayout.Button(tagInfo.title, tagStyles[tagInfo.color]) == true) {
									
									FlowSystem.RemoveTag(window, tagInfo);
									break;
									
								}
								
								++i;
//.........这里部分代码省略.........
开发者ID:zhaoluxyz,项目名称:Unity3d.UI.Windows,代码行数:101,代码来源:EditorWindow.cs


示例10: 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


示例11: CreateWindow

		public FlowWindow CreateWindow(FlowWindow.Flags flags) {
			
			var newId = this.AllocateId();
			var window = new FlowWindow(newId, flags);
			
			this.windows.Add(window);
			this.windowsCache.Clear();
			
			this.isDirty = true;
			
			return window;

		}
开发者ID:cg0206,项目名称:Unity3d.UI.Windows,代码行数:13,代码来源:FlowData.cs


示例12: GetWindowSize

		public Vector2 GetWindowSize(FlowWindow window) {
			
			var flowWindowWithLayout = FlowSystem.GetData().flowWindowWithLayout;
			var flowWindowWithLayoutScaleFactor = FlowSystem.GetData().flowWindowWithLayoutScaleFactor;
			if (flowWindowWithLayout == true) {

				return new Vector2(250f, 250f) * (1f + flowWindowWithLayoutScaleFactor);

			}
			
			return new Vector2(250f, 80f + (Mathf.CeilToInt(window.tags.Count / 3f)) * 15f);
			
		}
开发者ID:zhaoluxyz,项目名称:Unity3d.UI.Windows,代码行数:13,代码来源:EditorWindow.cs


示例13: DrawTransitionChooser

		public void DrawTransitionChooser(UnityEngine.UI.Windows.Plugins.Flow.FlowWindow.AttachItem attach, FlowWindow fromWindow, FlowWindow toWindow, Vector2 offset, float size) {

			var _size = Vector2.one * size;
			var rect = new Rect(Vector2.Lerp(fromWindow.rect.center, toWindow.rect.center, 0.5f) + offset - _size * 0.5f, _size);

			var transitionStyle = ME.Utilities.CacheStyle("UI.Windows.Styles.DefaultSkin", "TransitionIcon", (name) => FlowSystemEditorWindow.defaultSkin.FindStyle("TransitionIcon"));
			var transitionStyleBorder = ME.Utilities.CacheStyle("UI.Windows.Styles.DefaultSkin", "TransitionIconBorder", (name) => FlowSystemEditorWindow.defaultSkin.FindStyle("TransitionIconBorder"));
			if (transitionStyle != null && transitionStyleBorder != null) {

				if (fromWindow.GetScreen() != null) {

					System.Action onClick = () => {
						
						FlowChooserFilter.CreateTransition(fromWindow, toWindow, "/Transitions", (element) => {
							
							FlowSystem.Save();
							
						});

					};

					// Has transition or not?
					var hasTransition = attach.transition != null && attach.transitionParameters != null;
					if (hasTransition == true) {

						var hovered = rect.Contains(Event.current.mousePosition);
						if (attach.editor == null) {

							attach.editor = Editor.CreateEditor(attach.transitionParameters) as IPreviewEditor;
							hovered = true;

						}
						if (attach.editor.HasPreviewGUI() == true) {

							if (hovered == false) {

								attach.editor.OnDisable();

							} else {

								attach.editor.OnEnable();
								
							}

							var style = new GUIStyle(EditorStyles.toolbarButton);
							attach.editor.OnPreviewGUI(Color.white, rect, style, false, false, hovered);

						}

						if (GUI.Button(rect, string.Empty, transitionStyleBorder) == true) {

							onClick();

						}

					} else {
						
						GUI.Box(rect, string.Empty, transitionStyle);
						if (GUI.Button(rect, string.Empty, transitionStyleBorder) == true) {
							
							onClick();

						}

					}

				}

			}

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


示例14: GetRelativePath

		public static string GetRelativePath(FlowWindow window, string token) {
			
			var result = GetParentContainers(window, FlowSystem.GetContainers())
					.Reverse()
					.Select(w => w.directory)
					.Aggregate(string.Empty, (total, path) => total + token + path);
			
			if (string.IsNullOrEmpty(result) == true) {
				
				result = token + FlowDatabase.OTHER_NAME;

			}
			
			result += token + window.directory;
			
			return result;

		}
开发者ID:Trithilon,项目名称:Unity3d.UI.Windows,代码行数:18,代码来源:FlowCompilerSystem.cs


示例15: CompiledInfoIsInvalid

		/*
		private static bool CompiledInfoIsInvalid( FlowWindow flowWindow ) {

			return GetBaseClassName( flowWindow ) != flowWindow.compiledBaseClassName
				|| GetNamespace( flowWindow ) != flowWindow.compiledNamespace;
		}

		private static void UpdateInheritedClasses( string oldBaseClassName, string newBaseClassName, string oldDerivedClassName, string newDerivedClassName, string oldNamespace, string newNamespace ) {

			if ( string.IsNullOrEmpty( oldBaseClassName ) || string.IsNullOrEmpty( newBaseClassName ) ) {

				return;
			}

			var oldFullClassPath = oldNamespace + oldBaseClassName;
			var newFullClassPath = newNamespace + newBaseClassName;

			AssetDatabase.StartAssetEditing();

			try {

				var scripts =
					AssetDatabase.FindAssets( "t:MonoScript" )
						.Select( _ => AssetDatabase.GUIDToAssetPath( _ ) )
						.Select( _ => AssetDatabase.LoadAssetAtPath( _, typeof( MonoScript ) ) )
						.OfType<MonoScript>()
						.Where( _ => _.text.Contains( oldBaseClassName ) || _.text.Contains( oldDerivedClassName ) || _.text.Contains( oldNamespace ) )
						.Where( _ => _.name != newBaseClassName );

				foreach ( var each in scripts ) {

					var path = AssetDatabase.GetAssetPath( each );

					var lines = File.ReadAllLines( path );

					var writer = new StreamWriter( path );

					foreach ( var line in lines ) {

						writer.WriteLine( line.Replace( oldFullClassPath, newFullClassPath )
											  .Replace( oldNamespace, newNamespace )
											  .Replace( oldBaseClassName, newBaseClassName )
											  .Replace( oldDerivedClassName, newDerivedClassName ) );
					}

					writer.Dispose();
				}
			} catch ( Exception e ) { Debug.LogException( e ); }

			AssetDatabase.StopAssetEditing();
			AssetDatabase.Refresh( ImportAssetOptions.ForceUpdate );

		}
		
		private static void GenerateUIWindow( string fullpath, FlowWindow window, bool recompile = false ) {

			var isCompiledInfoInvalid = window.compiled && CompiledInfoIsInvalid( window );

			if ( window.compiled == false || recompile == true || isCompiledInfoInvalid ) {

				var baseClassName = GetBaseClassName( window );
				var derivedClassName = GetDerivedClassName( window );
				var classNamespace = GetNamespace( window );

				var baseClassTemplate = FlowTemplateGenerator.GenerateWindowLayoutBaseClass( baseClassName, classNamespace, GenerateTransitionMethods( window ) );
				var derivedClassTemplate = FlowTemplateGenerator.GenerateWindowLayoutDerivedClass( derivedClassName, baseClassName, classNamespace );
				
				#if !UNITY_WEBPLAYER
				var baseClassPath = ( fullpath + "/" + baseClassName + ".cs" ).Replace( "//", "/" );
				var derivedClassPath = ( fullpath + "/" + derivedClassName + ".cs" ).Replace( "//", "/" );
				#endif

				if ( baseClassTemplate != null && derivedClassTemplate != null ) {

					IO.CreateDirectory( fullpath, string.Empty );
					IO.CreateDirectory( fullpath, FlowDatabase.COMPONENTS_FOLDER );
					IO.CreateDirectory( fullpath, FlowDatabase.LAYOUT_FOLDER );
					IO.CreateDirectory( fullpath, FlowDatabase.SCREENS_FOLDER );
					
					#if !UNITY_WEBPLAYER

					Directory.CreateDirectory( fullpath );

					File.WriteAllText( baseClassPath, baseClassTemplate );

					if ( !File.Exists( derivedClassPath ) ) {

						File.WriteAllText( derivedClassPath, derivedClassTemplate );

						AssetDatabase.ImportAsset( derivedClassName );
					}

					AssetDatabase.ImportAsset( baseClassPath );

					#endif

				} else {

					return;
				}
//.........这里部分代码省略.........
开发者ID:Trithilon,项目名称:Unity3d.UI.Windows,代码行数:101,代码来源:FlowCompilerSystem.cs


示例16: GenerateTransitionMethods

		public static string GenerateTransitionMethods(FlowWindow window) {

			var flowData = FlowSystem.GetData();
			
			var transitions = flowData.windows.Where(w => window.attaches.Contains(w.id) && w.CanCompiled() && !w.IsContainer());

			var result = string.Empty;
			foreach (var each in transitions) {
				
				var className = each.directory;
				var classNameWithNamespace = Tpl.GetNamespace(each) + "." + Tpl.GetDerivedClassName(each);
				
				result += FlowTemplateGenerator.GenerateWindowLayoutTransitionMethod(className, classNameWithNamespace);

			}

			// Make FlowDefault() method if exists
			var c = 0;
			var everyPlatformHasUniqueName = false;
			foreach (var attachId in window.attaches) {
				
				var attachedWindow = FlowSystem.GetWindow(attachId);
				var tmp = UnityEditor.UI.Windows.Plugins.Flow.Flow.IsCompilerTransitionAttachedGeneration(attachedWindow);
				if (tmp == true) ++c;

			}

			everyPlatformHasUniqueName = c > 1;

			foreach (var attachId in window.attaches) {

				var attachedWindow = FlowSystem.GetWindow(attachId);
				if (attachedWindow.IsShowDefault() == true) {

					result += FlowTemplateGenerator.GenerateWindowLayoutTransitionMethodDefault();

				}

				result += UnityEditor.UI.Windows.Plugins.Flow.Flow.OnCompilerTransitionAttachedGeneration(attachedWindow, everyPlatformHasUniqueName);

			}

			// Run addons transition logic
			result += UnityEditor.UI.Windows.Plugins.Flow.Flow.OnCompilerTransitionGeneration(window);

			return result;

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


示例17: GetParentContainers

		private static IEnumerable<FlowWindow> GetParentContainers(FlowWindow window, IEnumerable<FlowWindow> containers) {
			
			var parent = containers.FirstOrDefault(where => where.attaches.Contains(window.id));
			
			while (parent != null) {
				
				yield return parent;
				parent = containers.FirstOrDefault(where => where.attaches.Contains(parent.id));

			}

		}
开发者ID:Trithilon,项目名称:Unity3d.UI.Windows,代码行数:12,代码来源:FlowCompilerSystem.cs


示例18: GetNamespace

		public static string GetNamespace(FlowWindow window) {
			
			return Tpl.GetNamespace() + IO.GetRelativePath(window, ".");

		}
开发者ID:Trithilon,项目名称:Unity3d.UI.Windows,代码行数:5,代码来源:FlowCompilerSystem.cs


示例19: CreateDefaultLink

		public FlowWindow CreateDefaultLink() {
			
			var newId = this.AllocateId();
			var window = new FlowWindow(newId, isDefaultLink: true);
			window.title = "Default Link";
			
			window.rect.width = 150f;
			window.rect.height = 30f;

			this.windows.Add(window);
			this.windowsCache.Clear();
			
			this.isDirty = true;
			
			return window;
			
		}
开发者ID:cg0206,项目名称:Unity3d.UI.Windows,代码行数:17,代码来源:FlowData.cs


示例20: 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



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# UnityTest.TestResult类代码示例发布时间:2022-05-26
下一篇:
C# Flow.Data类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap