public static void Draw(CanvasElement <TNodeData, TRouteData> canvasElement) { if (canvasElement != null) { canvasElement.OnDraw(); } }
public bool OnGUIDetail(Rect viewRect) { bool hasSelected = (canvas.operation.selection.SelectedCount() > 0); if (hasSelected) { CanvasElement <TNodeData, TRouteData> element = canvas.operation.selection.FirstSelected(); if (element != null) { bool handled = false; if (!handled) { Node <TNodeData, TRouteData> node = element as Node <TNodeData, TRouteData>; if (node != null && node.data != null) { handled = true; GUILayout.BeginArea(viewRect); node.data.OnDetailGUI(new Rect(Vector2.zero, viewRect.size)); GUILayout.EndArea(); } } if (!handled) { Route <TNodeData, TRouteData> route = element as Route <TNodeData, TRouteData>; if (route != null && route.data != null) { handled = true; GUILayout.BeginArea(viewRect); route.data.OnDetailGUI(new Rect(Vector2.zero, viewRect.size)); GUILayout.EndArea(); } } if (!handled) { Debug.LogError("invalid element selected"); } } } return(hasSelected); }
public static void Remove(CanvasElement <TNodeData, TRouteData> canvasElement) { canvasElement.OnRemove(); canvasElement.canvas = null; }
public static void Add(Canvas <TNodeData, TRouteData> canvas, CanvasElement <TNodeData, TRouteData> canvasElement) { canvasElement.canvas = canvas; canvasElement.OnAdd(); }
public bool HasSelected(CanvasElement <TNodeData, TRouteData> element) { return(currentSelected.Contains(element)); }
public int Select(CanvasElement <TNodeData, TRouteData> element) { currentSelected.Clear(); currentSelected.Add(element); return(currentSelected.Count); }