private GraphNode AddNewNode(ActionGraphNode node)
        {
            AddToAsset(node);

            Asset.Nodes.Add(node);

            return(View.OnNodeAdded(Asset, node));
        }
Пример #2
0
        public ActionGraphEditorSelectorNode(ActionGraph graph, ActionGraphNode node, ActionGraphPresenter presenter)
            : base(graph, node, presenter)
        {
            RecreateDrawer();

            Size = new Vector2(400, 300);

            PreferredWidth = drawRect.width;
        }
Пример #3
0
        public ActionGraphEditorNode(ActionGraph graph, ActionGraphNode node, ActionGraphPresenter presenter)
        {
            Graph      = graph;
            ActionNode = node;
            Presenter  = presenter;

            Size     = new Vector2(164, 64);
            Position = ActionNode.EditorPosition;
        }
Пример #4
0
        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;
            })));
        }
Пример #5
0
        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);
            }
        }
Пример #6
0
        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);
 }
Пример #9
0
 public GraphNode OnNodeAdded(ActionGraph asset, ActionGraphNode node)
 {
     return(CreateNodeEditor(node, asset));
 }