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


C# Flow.Data类代码示例

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


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

示例1: GenerateReturnMethod

		public static string GenerateReturnMethod(FlowSystemEditorWindow flowEditor, FD.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:RuFengLau,项目名称:Unity3d.UI.Windows,代码行数:31,代码来源:FunctionsAddon.cs

示例2: OnFlowWindowLayoutGUI

		public override void OnFlowWindowLayoutGUI(Rect rect, FD.FlowWindow window) {
			
			if (Heatmap.settings == null) Heatmap.settings = this.GetSettingsFile();

			var settings = Heatmap.settings;
			if (settings != null) {

				if (settings.show == true) {

					var data = settings.data.Get(window);
					data.UpdateMap();

					if (data != null && data.texture != null && data.status == HeatmapSettings.WindowsData.Window.Status.Loaded) {

						GUI.DrawTexture(rect, data.texture, ScaleMode.StretchToFill, alphaBlend: true);

					} else {
						
						if (this.noDataTexture != null) GUI.DrawTexture(rect, this.noDataTexture, ScaleMode.StretchToFill, alphaBlend: true);

					}

				}

			}

		}
开发者ID:RuFengLau,项目名称:Unity3d.UI.Windows,代码行数:27,代码来源:HeatmapAddon.cs

示例3: GenerateTransitionMethod

		public static string GenerateTransitionMethod(FlowSystemEditorWindow flowEditor, FD.FlowWindow windowFrom, FD.FlowWindow windowTo) {
			
			var file = Resources.Load("UI.Windows/ABTesting/Templates/TemplateTransitionMethod") as TextAsset;
			if (file == null) {
				
				Debug.LogError("ABTesting Template Loading Error: Could not load template 'TemplateTransitionMethod'");
				
				return string.Empty;
				
			}
			
			var data = FlowSystem.GetData();
			if (data == null) return string.Empty;
			
			if (windowTo.IsABTest() == false) {
				
				return string.Empty;
				
			}

			var result = string.Empty;
			var part = file.text;

			var methodPattern = "(item, h) => WindowSystemFlow.DoFlow<{0}>(this, item, h, null)";
			var methods = string.Empty;
			var methodList = new List<string>();

			foreach (var item in windowTo.abTests.items) {

				var window = FlowSystem.GetWindow(item.attachItem.targetId);
				if (window == null) {
					
					methodList.Add("null");

				} else {
					
					var classNameWithNamespace = Tpl.GetClassNameWithNamespace(window);
					methodList.Add(string.Format(methodPattern, classNameWithNamespace));

				}

			}

			methods = string.Join(", ", methodList.ToArray());

			result +=
				part.Replace("{METHOD_NAMES}", methods)
					.Replace("{FLOW_FROM_ID}", windowFrom.id.ToString())
					.Replace("{FLOW_TO_ID}", windowTo.id.ToString());
			
			return result;
			
		}
开发者ID:MJunak,项目名称:Unity3d.UI.Windows,代码行数:53,代码来源:ABTestingAddon.cs

示例4: GenerateTransitionMethod

		public static string GenerateTransitionMethod(FlowSystemEditorWindow flowEditor, FD.FlowWindow windowFrom, FD.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.GetClassNameWithNamespace(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:MJunak,项目名称:Unity3d.UI.Windows,代码行数:51,代码来源:FunctionsAddon.cs

示例5: OnFlowWindowLayoutGUI

		public override void OnFlowWindowLayoutGUI(Rect rect, FD.FlowWindow window) {
			
			if (Heatmap.settings == null) Heatmap.settings = Heatmap.GetSettingsFile();

			var settings = Heatmap.settings;
			if (settings != null) {

				if (settings.show == true) {

					var data = settings.data.Get(window);
					//data.UpdateMap();

					if (data != null && data.texture != null && data.status == HeatmapSettings.WindowsData.Window.Status.Loaded) {

						LayoutWindowType screen;
						var layout = HeatmapSystem.GetLayout(window.id, out screen);
						if (layout == null) return;

						var scaleFactor = HeatmapSystem.GetFactor(new Vector2(layout.root.editorRect.width, layout.root.editorRect.height), rect.size);
						//var scaleFactorCanvas = layout.editorScale > 0f ? 1f / layout.editorScale : 1f;
						//scaleFactor *= scaleFactorCanvas;

						var r = layout.root.editorRect;
						r.x *= scaleFactor;
						r.y *= scaleFactor;
						r.x += rect.x + rect.width * 0.5f;
						r.y += rect.y + rect.height * 0.5f;
						r.width *= scaleFactor;
						r.height *= scaleFactor;

						var c = Color.white;
						c.a = 0.5f;
						GUI.color = c;
						GUI.DrawTexture(r, data.texture, ScaleMode.StretchToFill, alphaBlend: false);
						GUI.color = Color.white;

					} else {
						
						if (this.noDataTexture != null) GUI.DrawTexture(rect, this.noDataTexture, ScaleMode.ScaleToFit, alphaBlend: true);

					}

				}

			}

		}
开发者ID:anton-nesterenko,项目名称:Unity3d.UI.Windows,代码行数:47,代码来源:HeatmapAddon.cs

示例6: DrawWindowLayout

		public void DrawWindowLayout(FD.FlowWindow window) {
			
			var flowWindowWithLayout = FlowSystem.GetData().HasView(FlowView.Layout);
			if (flowWindowWithLayout == true) {

				GUILayout.Box(string.Empty, FlowSystemEditorWindow.styles.layoutBoxStyle, GUILayout.ExpandHeight(true), GUILayout.ExpandWidth(true));
				var rect = GUILayoutUtility.GetLastRect();
				
				if (window.OnPreviewGUI(rect,
				                        FlowSystemEditorWindow.defaultSkin.button,
				                        FlowSystemEditorWindow.styles.layoutBoxStyle,
				                        drawInfo: true,
				                        selectable: true,
				                        onCreateScreen: () => {
					
					this.SelectWindow(window);
					FlowChooserFilter.CreateScreen(Selection.activeObject, window.compiledNamespace, "/Screens", () => {
						
						this.SelectWindow(window);
						
					});
					
				}, onCreateLayout: () => {
					
					this.SelectWindow(window);
					Selection.activeObject = window.GetScreen();
					FlowChooserFilter.CreateLayout(Selection.activeObject, Selection.activeGameObject, () => {
						
						this.SelectWindow(window);
						
					});
					
				}) == true) {
					
					// Set for waiting connection
					var element = WindowLayoutElement.waitForComponentConnectionElementTemp;
					
					this.WaitForAttach(window.id, element);
					
					WindowLayoutElement.waitForComponentConnectionTemp = false;
					
				}
				
				UnityEditor.UI.Windows.Plugins.Flow.Flow.OnDrawWindowLayoutGUI(rect, window);
				
			}
			
		}
开发者ID:MJunak,项目名称:Unity3d.UI.Windows,代码行数:48,代码来源:EditorWindow.cs

示例7: DrawTransitionChooser

		public void DrawTransitionChooser(AttachItem attach, FD.FlowWindow fromWindow, FD.FlowWindow toWindow, bool doubleSided) {
			
			if (this.drawWindowContent == false) return;

			if (toWindow.IsEnabled() == false) return;
			if (toWindow.IsContainer() == true) return;

			var factor = 0.5f;
			var transitionsContainer = fromWindow;
			var namePrefix = string.Empty;

			if (fromWindow.IsSmall() == true &&
				fromWindow.IsABTest() == true) {

				// is ABTest
				//Debug.Log(fromWindow.id + " => " + toWindow.id + " :: " + attach.index + " :: " + doubleSided);
				transitionsContainer = FlowSystem.GetWindow(fromWindow.abTests.sourceWindowId);
				if (transitionsContainer == null) return;

				namePrefix = string.Format("Variant{0}", attach.index.ToString());
				factor = 0.2f;

			} else {

				if (toWindow.IsSmall() == true) {

					if (toWindow.IsFunction() == false) return;

				}

			}

			if (FlowSystem.GetData().modeLayer == ModeLayer.Audio) {

				if (FlowSystem.GetData().HasView(FlowView.AudioTransitions) == false) return;

			} else {
				
				if (FlowSystem.GetData().HasView(FlowView.VideoTransitions) == false) return;

			}

			const float size = 32f;
			const float offset = size * 0.5f + 5f;

			Vector2 centerOffset = Flow.OnDrawNodeCurveOffset(this, attach, fromWindow, toWindow, doubleSided);

			if (doubleSided == true) {

				var q = Quaternion.LookRotation(toWindow.rect.center - fromWindow.rect.center, Vector3.back);
				var attachRevert = FlowSystem.GetAttachItem(toWindow.id, fromWindow.id);
				
				this.DrawTransitionChooser(attachRevert, toWindow, toWindow, fromWindow, centerOffset, q * Vector2.left * offset, size, factor, namePrefix);
				this.DrawTransitionChooser(attach, fromWindow, fromWindow, toWindow, centerOffset, q * Vector2.right * offset, size, factor, namePrefix);

			} else {

				this.DrawTransitionChooser(attach, transitionsContainer, fromWindow, toWindow, centerOffset, Vector2.zero, size, factor, namePrefix);

			}

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

示例8: DrawTags

		private void DrawTags(FD.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:MJunak,项目名称:Unity3d.UI.Windows,代码行数:101,代码来源:EditorWindow.cs

示例9: OnFlowWindowGUI

		public override void OnFlowWindowGUI(FD.FlowWindow window) {

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

			if (data.modeLayer == ModeLayer.Audio) {

				if (window.IsContainer() == true ||
				    window.IsSmall() == true ||
				    window.IsShowDefault() == true)
					return;

				var screen = window.GetScreen();
				if (screen != null) {

					GUILayout.BeginHorizontal();
					{
						var playType = (int)screen.audio.playType;
						playType = GUILayoutExt.Popup(playType, new string[2] { "Keep Current", "Restart If Equals" }, FlowSystemEditorWindow.defaultSkin.label, GUILayout.Width(EditorGUIUtility.labelWidth));
						screen.audio.playType = (UnityEngine.UI.Windows.Audio.Window.PlayType)playType;

						var rect = GUILayoutUtility.GetLastRect();

						/*var newId = */AudioPopupEditor.Draw(new Rect(rect.x + rect.width, rect.y, window.rect.width - EditorGUIUtility.labelWidth - 10f, rect.height), screen.audio.id, (result) => {

							screen.audio.id = result;
							window.audioEditor = null;

						}, screen.audio.clipType, screen.audio.flowData.audio, null);
						/*if (newId != screen.audio.id) {

							screen.audio.id = newId;
							window.audioEditor = null;

						}*/

					}
					GUILayout.EndHorizontal();
					
					var state = data.audio.GetState(screen.audio.clipType, screen.audio.id);
					if (state != null && state.clip != null) {
						
						GUILayout.BeginVertical();
						{

							GUILayout.Box(string.Empty, FlowSystemEditorWindow.styles.layoutBoxStyle, GUILayout.ExpandHeight(true), GUILayout.ExpandWidth(true));
							var rect = GUILayoutUtility.GetLastRect();

							if (Event.current.type == EventType.MouseDown && rect.Contains(Event.current.mousePosition) == true) {

								window.audioEditor = null;

							}

							if (window.audioEditor == null) {

								EditorPrefs.SetBool("AutoPlayAudio", false);
								window.audioEditor = Editor.CreateEditor(state.clip);
								//System.Type.GetType("AudioUtil").InvokeMember("StopClip", System.Reflection.BindingFlags.Static | System.Reflection.BindingFlags.Public, null, null, new object[] { state.clip });

							}

							if (Event.current.type != EventType.MouseDrag && Event.current.type != EventType.DragPerform) {

								window.audioEditor.OnPreviewGUI(rect, EditorStyles.helpBox);
								GUILayout.BeginHorizontal();
								window.audioEditor.OnPreviewSettings();
								GUILayout.EndHorizontal();

							}

						}
						GUILayout.EndVertical();
						
					}

				}

			}

		}
开发者ID:anton-nesterenko,项目名称:Unity3d.UI.Windows,代码行数:81,代码来源:AudioAddon.cs

示例10: DrawWindowToolbar


//.........这里部分代码省略.........
						} else {
							
							// Was not as default
							FlowSystem.GetDefaultWindows().Add(id);
							
						}
						
						FlowSystem.SetDirty();
						
					}
					
				}
				
				GUILayout.FlexibleSpace();
				
				if (window.IsSmall() == false && FlowSceneView.IsActive() == false && window.storeType == FD.FlowWindow.StoreType.NewScreen) {

					var state = GUILayout.Button("Screen", buttonDropdownStyle);
					if (Event.current.type == EventType.Repaint) {

						this.layoutStateSelectButtonRect = GUILayoutUtility.GetLastRect();

					}

					if (state == true) {

						var menu = new GenericMenu();
						menu.AddItem(new GUIContent("Select Package"), on: false, func: () => { this.SelectWindow(window); });
						
						if (window.compiled == true) {

							menu.AddItem(new GUIContent("Edit..."), on: false, func: () => {

								var path = Path.GetDirectoryName(AssetDatabase.GetAssetPath(window.GetScreen()));
								var filename = window.compiledDerivedClassName + ".cs";
								EditorUtility.OpenWithDefaultApp(string.Format("{0}/../{1}", path, filename));

							});

						}

						menu.AddItem(new GUIContent("Create on Scene"), on: false, func: () => { this.CreateOnScene(window); });

						var screen = window.GetScreen();

						var methodsCount = 0;
						WindowSystem.CollectCallVariations(screen, (types, names) => {

							++methodsCount;

						});

						menu.AddDisabledItem(new GUIContent("Calls/Methods: " + methodsCount.ToString()));
						menu.AddSeparator("Calls/");

						if (window.compiled == true &&
						    screen != null) {

							methodsCount = 0;
							WindowSystem.CollectCallVariations(screen, (types, names) => {

								var parameters = new List<string>();
								for (int i = 0; i < types.Length; ++i) {

									parameters.Add(ME.Utilities.FormatParameter(types[i]) + " " + names[i]);
开发者ID:MJunak,项目名称:Unity3d.UI.Windows,代码行数:66,代码来源:EditorWindow.cs

示例11: GetWindowSize

		public Vector2 GetWindowSize(FD.FlowWindow window) {
			
			var flowWindowWithLayout = FlowSystem.GetData().HasView(FlowView.Layout);
			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:MJunak,项目名称:Unity3d.UI.Windows,代码行数:13,代码来源:EditorWindow.cs

示例12: Info

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

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

示例13: OnCompilerTransitionAttachedGeneration

		public override string OnCompilerTransitionAttachedGeneration(FD.FlowWindow windowFrom, FD.FlowWindow windowTo, bool everyPlatformHasUniqueName) {

			var settings = Social.settings;
			if (settings != null) {

				var data = settings.data.Get(windowTo);
				if (data != null && data.settings != null && settings.IsPlatformActive(data.settings) == true) {

					return FlowSocialTemplateGenerator.GenerateTransitionMethod(data.settings, everyPlatformHasUniqueName);
				
				}

			}

			return base.OnCompilerTransitionAttachedGeneration(windowFrom, windowTo, everyPlatformHasUniqueName);
			
		} 
开发者ID:Cyberbanan,项目名称:Unity3d.UI.Windows,代码行数:17,代码来源:SocialAddon.cs

示例14: SelectWindow

		private void SelectWindow(FD.FlowWindow window) {

			if (window.compiled == false) {
				
				this.ShowNotification(new GUIContent("You need to compile this window to use `Select` command"));
					
			} else {

				window.Select();

			}

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

示例15: IsVisible

		public bool IsVisible(FD.FlowWindow window) {

			if (window.isMovingState == true) return true;

			if (this.zoomDrawer.GetZoom() < 1f) {

				return true;

			}

			return window.isVisibleState = this.ContainsRect(window.rect);

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


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