private GraphNode AddNewNode(ActionGraphNode node) { AddToAsset(node); Asset.Nodes.Add(node); return(View.OnNodeAdded(Asset, node)); }
public ActionGraphEditorSelectorNode(ActionGraph graph, ActionGraphNode node, ActionGraphPresenter presenter) : base(graph, node, presenter) { RecreateDrawer(); Size = new Vector2(400, 300); PreferredWidth = drawRect.width; }
public ActionGraphEditorNode(ActionGraph graph, ActionGraphNode node, ActionGraphPresenter presenter) { Graph = graph; ActionNode = node; Presenter = presenter; Size = new Vector2(164, 64); Position = ActionNode.EditorPosition; }
private System.Type FindNodeEditor(ActionGraphNode node) { return(NodeEditors.FirstOrDefault(t => t.CustomAttributes.Any( a => { if (a.AttributeType == typeof(CustomActionEditor) && a.ConstructorArguments.Count >= 1) { return a.ConstructorArguments[0].Value == node.GetType(); } return false; }))); }
private void ConnectNodeEditor(GraphNode parent, ActionGraphNode child) { ActionGraphEditorNode foundNode; if (NodeLookup.TryGetValue(child, out foundNode)) { if (GraphNode.CanMakeConnection(parent, foundNode)) { GraphNode.MakeConnection(parent, foundNode); } } else { Debug.LogError($"Couldn't find editor node for {child.name}", child); } }
private ActionGraphEditorNode CreateNodeEditor(ActionGraphNode node, ActionGraph graph) { var editorNodeType = FindNodeEditor(node); ActionGraphEditorNode editorNode = null; if (editorNodeType != null) { editorNode = Activator.CreateInstance(editorNodeType, graph, node, Presenter) as ActionGraphEditorNode; } else { editorNode = new ActionGraphEditorNode(graph, node, Presenter); } NodeLookup[node] = editorNode; Nodes.AddNode(editorNode); return(editorNode); }
public ActionGraphEditorAnimParamNode(ActionGraph graph, ActionGraphNode node, ActionGraphPresenter presenter) : base(graph, node, presenter) { }
public void DisconnectNodes(ActionGraphNode parent, ActionGraphNode node) { View.DisconnectNodes(parent, node); }
public GraphNode OnNodeAdded(ActionGraph asset, ActionGraphNode node) { return(CreateNodeEditor(node, asset)); }