public void AddPoint(Vector2 point, LayoutTag tag, WindowComponent component) { this.points.Add(new Point(point, tag, component)); this.changed = true; this.UpdateMap(); }
public static void Send(LayoutTag tag, WindowBase window, WindowComponent component, Vector2 localNormalizedPoint) { var flowWindow = Flow.FlowSystem.GetWindow(window); if (flowWindow == null) { Debug.LogWarningFormat("[ Heatmap ] FlowWindow not found. Source {0} used ({1}).", window, tag); return; } // Offline #if UNITY_EDITOR var modulesPath = FlowSystem.GetData().GetModulesPath(); var settings = ME.EditorUtilities.GetAssetsOfType <HeatmapSettings>(modulesPath, useCache: false).FirstOrDefault(); #else HeatmapSettings settings = null; #endif if (settings == null) { return; } var data = settings.data.Get(flowWindow); data.AddPoint(localNormalizedPoint, new Vector2Int(Screen.width, Screen.height), flowWindow.id, tag, component); }
public Point(Vector2 point, LayoutTag tag, WindowComponent component) { this.x = point.x; this.y = point.y; this.componentInfo = new ComponentInfo(tag, component); }
public Component(LayoutTag tag, string description) { #if UNITY_EDITOR this.description = description; #endif this.tag = tag; }
private void AddComponentLink(LayoutTag tag, string description) { var list = this.components.ToList(); list.Add(new Component(tag, description)); this.components = list.ToArray(); }
private void AddComponentLink(LayoutTag tag) { var list = this.components.ToList(); list.Add(new Component(tag)); this.components = list.ToArray(); }
public Point(Vector2 point, LayoutTag tag, WindowComponent component) { this.x = point.x; this.y = point.y; this.tag = tag; }
public ComponentLink(int targetWindowId, LayoutTag sourceComponentTag, string comment) { this.targetWindowId = targetWindowId; this.sourceComponentTag = sourceComponentTag; #if UNITY_EDITOR this.comment = string.IsNullOrEmpty(comment) ? string.Empty : ("On " + comment.ToLower().UppercaseWords().Trim().Replace(" ", "") + " Action"); #endif }
public WindowLayoutElement GetLayoutComponent(LayoutTag tag) { var screen = this.GetScreen().Load <LayoutWindowType>(); if (screen != null && screen.GetCurrentLayout().layout != null) { return(screen.GetCurrentLayout().layout.GetRootByTag(tag)); } return(null); }
public WindowLayoutElement GetLayoutComponent(LayoutTag tag) { var screen = this.GetScreen() as LayoutWindowType; if (screen != null && screen.layout.layout != null) { return(screen.layout.layout.GetRootByTag(tag)); } return(null); }
public WindowLayoutElement GetContainer(LayoutTag tag) { var component = this.components.FirstOrDefault((c) => c.tag == tag); if (component != null) { return(component.GetContainer()); } return(null); }
public Point(Vector2 point, Vector2Int screenSize, int screenId, LayoutTag tag, WindowComponent component) { this.screenId = screenId; this.screenWidth = screenSize.x; this.screenHeight = screenSize.y; this.x = point.x; this.y = point.y; this.tag = tag; }
public T Get <T>(LayoutTag tag = LayoutTag.None) where T : WindowComponent { if (tag != LayoutTag.None) { if (this.tag != tag) { return(null); } } return(this.instance as T); }
public T Get <T>(LayoutTag tag = LayoutTag.None) where T : WindowComponent { for (var i = 0; i < this.components.Length; ++i) { var item = this.components[i].Get <T>(tag); if (item != null) { return(item); } } return(default(T)); }
public T Get <T>(LayoutTag tag = LayoutTag.None) where T : WindowComponent { foreach (var component in this.components) { var item = component.Get <T>(tag); if (item != null) { return(item); } } return(default(T)); }
public static void Send(LayoutTag tag, WindowBase window, WindowComponent component, Vector2 localNormalizedPoint) { var flowWindow = Flow.FlowSystem.GetWindow(window); if (flowWindow == null) { Debug.LogWarningFormat("[ Heatmap ] FlowWindow not found. Source {0} used ({1}).", window, tag); return; } // TODO: Send to server // Request the new map from server. // Use tag, window and component as a keys. // Offline #if UNITY_EDITOR var settings = ME.EditorUtilities.GetAssetsOfType <HeatmapSettings>(useCache: false).FirstOrDefault(); #else HeatmapSettings settings = null; #endif if (settings == null) { return; } var data = settings.data.Get(flowWindow); data.status = HeatmapSettings.WindowsData.Window.Status.Loading; data.size = (window as LayoutWindowType).layout.GetLayoutInstance().GetSize(); data.AddPoint(localNormalizedPoint, tag, component); #if UNITY_EDITOR UnityEditor.EditorUtility.SetDirty(settings); #endif data.status = HeatmapSettings.WindowsData.Window.Status.Loaded; }
public ComponentInfo(LayoutTag tag, WindowComponent component) { this.tag = tag; this.x = 0f; this.y = 0f; this.w = 0f; this.h = 0f; //var rect = (component.transform as RectTransform).rect; var corners = new Vector3[4]; (component.transform as RectTransform).GetWorldCorners(corners); var leftBottom = this.GetScreenPoint(component, corners[0]); var topRight = this.GetScreenPoint(component, corners[2]); this.x = leftBottom.x; this.y = leftBottom.y; this.w = topRight.x - leftBottom.x; this.h = topRight.y - leftBottom.y; }
/// <summary> /// 分析标签 /// </summary> /// <param name="parser">TemplateParser</param> /// <param name="tc">Token集合</param> /// <returns></returns> public ITag Parse(TemplateParser parser, TokenCollection tc) { if (tc != null && parser != null && tc.Count > 2 && Utility.IsEqual(tc.First.Text, Field.KEY_LAYOUT) && (tc[1].TokenKind == TokenKind.LeftParentheses) && tc.Last.TokenKind == TokenKind.RightParentheses) { LayoutTag tag = new LayoutTag(); tag.Path = parser.Read(new TokenCollection(tc, 2, tc.Count - 2)); //if(!(path is StringTag)) //{ // throw new Exception(""); //} while (parser.MoveNext()) { tag.Children.Add(parser.Current); } return(tag); } return(null); }
public void Reset() { this.tag = LayoutTag.None; }
public WindowLayoutElement GetRootByTag(LayoutTag tag) { return this.elements.FirstOrDefault((element) => element.tag == tag); }
public WindowLayoutElement GetRootByTag(LayoutTag tag) { return(this.elements.FirstOrDefault((element) => element.tag == tag)); }
public WindowLayoutElement GetLayoutComponent(LayoutTag tag) { var screen = this.GetScreen() as LayoutWindowType; if (screen != null && screen.layout.layout != null) { return screen.layout.layout.GetRootByTag(tag); } return null; }
private void RemoveComponentLink(LayoutTag tag) { this.components = this.components.Where((c) => c.tag != tag).ToArray(); }
public static void Send(LayoutTag tag, WindowBase window, WindowComponent component, Vector2 localNormalizedPoint) { var flowWindow = Flow.FlowSystem.GetWindow(window); if (flowWindow == null) { Debug.LogWarningFormat("[ Heatmap ] FlowWindow not found. Source {0} used ({1}).", window, tag); return; } // Offline #if UNITY_EDITOR var modulesPath = FlowSystem.GetData().GetModulesPath(); var settings = ME.EditorUtilities.GetAssetsOfType<HeatmapSettings>(modulesPath, useCache: false).FirstOrDefault(); #else HeatmapSettings settings = null; #endif if (settings == null) return; var data = settings.data.Get(flowWindow); data.AddPoint(localNormalizedPoint, new Vector2Int(Screen.width, Screen.height), flowWindow.id, tag, component); }
public static void Send(LayoutTag tag, WindowBase window, WindowComponent component, Vector2 localNormalizedPoint) { var flowWindow = Flow.FlowSystem.GetWindow(window); if (flowWindow == null) { Debug.LogWarningFormat("[ Heatmap ] FlowWindow not found. Source {0} used ({1}).", window, tag); return; } // Offline #if UNITY_EDITOR var settings = ME.EditorUtilities.GetAssetsOfType<HeatmapSettings>(useCache: false).FirstOrDefault(); #else HeatmapSettings settings = null; #endif if (settings == null) return; var data = settings.data.Get(flowWindow); data.status = HeatmapSettings.WindowsData.Window.Status.Loading; //data.size = new Vector2(Screen.width, Screen.height); data.AddPoint(localNormalizedPoint, tag, component); //TODO: change to MathX //Rounding coords to 2 digets after point //var roundedX = Math.Round((double)localNormalizedPoint.x, 2).ToString(); //var roundedY = Math.Round((double)localNormalizedPoint.y, 2).ToString(); /* HeatmapSystem.sender.Post("http://localhost:8080/hm_save", new Dictionary<string, string>() { {"key", settings.authKey}, {"uid", SystemInfo.deviceUniqueIdentifier}, {"windowId", data.id.ToString()}, {"tag", ((int)tag).ToString()}, {"x", roundedX}, {"y", roundedY} }, null);*/ }
public T GetLayoutComponent <T>(LayoutTag tag = LayoutTag.None) where T : WindowComponent { return(this.layout.Get <T>(tag)); }
public WindowLayoutElement GetLayoutContainer(LayoutTag tag) { return(this.layout.GetContainer(tag)); }
public Component(LayoutTag tag) { this.tag = tag; }
public static void Send(LayoutTag tag, WindowBase window, WindowComponent component, Vector2 localNormalizedPoint) { var flowWindow = Flow.FlowSystem.GetWindow(window); if (flowWindow == null) { Debug.LogWarningFormat("[ Heatmap ] FlowWindow not found. Source {0} used ({1}).", window, tag); return; } // TODO: Send to server // Request the new map from server. // Use tag, window and component as a keys. // Offline #if UNITY_EDITOR var settings = ME.EditorUtilities.GetAssetsOfType<HeatmapSettings>(useCache: false).FirstOrDefault(); #else HeatmapSettings settings = null; #endif if (settings == null) return; var data = settings.data.Get(flowWindow); data.status = HeatmapSettings.WindowsData.Window.Status.Loading; data.size = (window as LayoutWindowType).layout.GetLayoutInstance().GetSize(); data.AddPoint(localNormalizedPoint, tag, component); #if UNITY_EDITOR UnityEditor.EditorUtility.SetDirty(settings); #endif data.status = HeatmapSettings.WindowsData.Window.Status.Loaded; }
public void AddPoint(Vector2 point, Vector2Int screenSize, int screenId, LayoutTag tag, WindowComponent component) { var newPoint = new Point(point, screenSize, screenId, tag, component); this.points.Add(newPoint); this.changed = true; Analytics.Analytics.SendScreenPoint(screenId, newPoint.screenWidth, newPoint.screenHeight, (byte)newPoint.tag, newPoint.x, newPoint.y); }
public void GetLayoutComponent <T>(out T component, LayoutTag tag = LayoutTag.None) where T : WindowComponent { component = this.GetLayoutComponent <T>(tag); }