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

C# Flow.Data类代码示例

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

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



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

		public override void OnFlowWindowScreenMenuGUI(FD.FlowWindow window, GenericMenu menu) {
			
			if (window.isVisibleState == false) return;
			if (window.IsContainer() == true) return;
			if (window.IsSmall() == true && window.IsFunction() == true) return;
			if (window.IsShowDefault() == true) return;
			
			if (Heatmap.settings == null) Heatmap.settings = Heatmap.GetSettingsFile();
			
			var settings = Heatmap.settings;
			if (settings != null) {
				
				var data = settings.data.Get(window);
				if (data == null) return;

				foreach (var item in settings.items) {
					
					if (item.show == true && item.enabled == true) {
						
						foreach (var serviceBase in this.editor.services) {

							var service = serviceBase as IAnalyticsService;
							if (service.GetServiceName() == item.serviceName) {
								
								var key = string.Format("{0}_{1}", item.serviceName, window.id);
								var windowId = window.id;
								menu.AddItem(new GUIContent("Open Heatmap..."), false, () => {

									//this.fullScreenData = this.heatmapResultsCache[key];
									this.fullScreenTexture = this.heatmapTexturesCache[key];
									this.fullScreenWindowId = windowId;
									this.fullScreenEditor = null;

									this.openFullScreen = true;
									this.flowEditor.SetDisabled();

								});

							}

						}

					}

				}

			}

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


示例13: OnFlowWindowLayoutGUI

		public override void OnFlowWindowLayoutGUI(Rect rect, FD.FlowWindow window) {
			
			if (window.isVisibleState == false) return;
			if (window.IsContainer() == true) return;
			if (window.IsSmall() == true && window.IsFunction() == true) return;
			if (window.IsShowDefault() == true) return;

			if (Heatmap.settings == null) Heatmap.settings = Heatmap.GetSettingsFile();

			var settings = Heatmap.settings;
			if (settings != null) {
				
				var data = settings.data.Get(window);
				if (data == null) return;
				
				LayoutWindowType screen;
				var layout = HeatmapSystem.GetLayout(window.id, out screen);
				if (layout == null) return;

				var targetScreenSize = new Vector2(layout.root.editorRect.width, layout.root.editorRect.height);

				foreach (var item in settings.items) {
					
					if (item.show == true && item.enabled == true) {

						foreach (var serviceBase in this.editor.services) {
							
							var service = serviceBase as IAnalyticsService;
							if (service.GetServiceName() == item.serviceName) {

								var key = string.Format("{0}_{1}", item.serviceName, window.id);
								HeatmapResult result;
								if (this.heatmapResultsCache.TryGetValue(key, out result) == true) {

									if (result != null) {

										var texture = this.heatmapTexturesCache[key];
										if (texture != null) {
											
											var scaleFactor = HeatmapSystem.GetFactor(targetScreenSize, 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;
											GUI.color = c;
											GUI.DrawTexture(r, texture, ScaleMode.StretchToFill, alphaBlend: true);
											GUI.color = Color.white;

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

									} else {

										// still loading...

									}

								} else {

									if (Event.current.type == EventType.Repaint) {

										var rectSize = targetScreenSize;//rect.size;
										var rootRect = layout.root.editorRect;

										this.heatmapResultsCache.Add(key, null);
										this.heatmapTexturesCache.Add(key, null);
										service.GetHeatmapData(window.id, (int)targetScreenSize.x, (int)targetScreenSize.y, item.userFilter, (_result) => {

											var heatmapResult = _result as HeatmapResult;

											// Convert normalized points to real points
											for (int i = 0; i < heatmapResult.points.Length; ++i) {

												var root = layout.GetRootByTag((LayoutTag)heatmapResult.points[i].tag);
												if (root != null) {

													var xn = heatmapResult.points[i].x;
													var yn = heatmapResult.points[i].y;

													var sourceRect = root.editorRect;
													var radius = (float)HeatmapVisualizer.GetRadius();
													sourceRect.x += radius;
													sourceRect.y += radius;
													sourceRect.width -= radius * 2f;
													sourceRect.height -= radius * 2f;

													var scaleFactor = HeatmapSystem.GetFactor(targetScreenSize, rectSize);
													var r = sourceRect;
													r.x *= scaleFactor;
													r.y *= scaleFactor;
//.........这里部分代码省略.........
开发者ID:MJunak,项目名称:Unity3d.UI.Windows,代码行数:101,代码来源:HeatmapAddon.cs


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


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


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


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


示例18: DrawStates

		private void DrawStates(FD.CompletedState[] states, FD.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 == FD.CompletedState.NotReady) {
					
					color = new Color(1f, 0.3f, 0.3f, 1f);
					
				} else if (state == FD.CompletedState.Ready) {
					
					color = new Color(0.3f, 1f, 0.3f, 1f);
					
				} else if (state == FD.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:MJunak,项目名称:Unity3d.UI.Windows,代码行数:53,代码来源:EditorWindow.cs


示例19: DrawTransitionChooser

		public void DrawTransitionChooser(FD.FlowWindow.AttachItem attach, FD.FlowWindow fromWindow, FD.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) {

						GUI.DrawTexture(rect, Texture2D.blackTexture, ScaleMode.ScaleAndCrop, false);

						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:hxingchh,项目名称:Unity3d.UI.Windows,代码行数:74,代码来源:EditorWindow.cs


示例20: IsVisible

		public bool IsVisible(FD.FlowWindow window) {

			/*var scrollPos = FlowSystem.GetScrollPosition();
			var rect = new Rect(scrollPos.x - this.scrollRect.width * 0.5f + this.scrollRect.x,
			                    scrollPos.y + this.scrollRect.y,
			                    this.scrollRect.width,
			                    this.scrollRect.height);

			var newState = true;//rect.ScaleSizeBy(this.zoomDrawer.GetZoom()).Overlaps(window.rect.ScaleSizeBy(this.zoomDrawer.GetZoom()));

			if (newState == true &&
				window.isVisibleState == false) {

				window.isVisibleState = true;
				this.Repaint();
				return false;

			}

			return newState;*/

			return true;

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



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C# Flow.FlowWindow类代码示例发布时间:2022-05-26
下一篇:
C# UI.VertexHelper类代码示例发布时间: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