コード例 #1
0
    public override void InitNodeEditor(Vector2 pos, NodeData.NodeType _type, BlueprintEditor _m_Editor)
    {
        base.InitNodeEditor(pos, _type, _m_Editor);

        // -- ALL EVENTS HAVE AT LEAST ONE OUTPUT
        outputs.Add(new Connector(this, Connector.FlowType.Output));
    }
コード例 #2
0
    void AddNodeCallback(object userData)
    {
        NodeData.NodeType _type = (NodeData.NodeType)userData;

        int count = 0;

        foreach (Node _n in m_Editor.CurrentBlueprint.nodes)
        {
            if (_n.nodeType == _type)
            {
                count++;
            }
        }

        Node n = null;

        switch (_type)
        {
        case NodeData.NodeType.Comment:
            n = ScriptableObject.CreateInstance <CommentNode>();
            break;

        case NodeData.NodeType.Debug:
            //n = ScriptableObject.CreateInstance<CommentNode>();
            break;

        case NodeData.NodeType.Event:
            n = ScriptableObject.CreateInstance <EventNode>();
            break;

        case NodeData.NodeType.Function:
            // n = ScriptableObject.CreateInstance<CommentNode>();
            break;

        case NodeData.NodeType.Variable:
            //n = ScriptableObject.CreateInstance<CommentNode>();
            break;
        }

        n.InitNodeEditor(mousePos, _type, m_Editor);
        AssetDatabase.CreateAsset(n, "Assets/Blueprints/" + m_Editor.CurrentBlueprint.str_Name + "/nodes/" + _type.ToString() + "Node_" + count.ToString() + ".asset");
        AssetDatabase.SaveAssets();

        m_Editor.CurrentBlueprint.nodes.Add(n);

        m_Editor.SaveCurrentBlueprint();

        m_Editor.Repaint();
    }
コード例 #3
0
 public virtual void InitNodeEditor(Vector2 pos, NodeData.NodeType _type, BlueprintEditor _m_Editor)
 {
     position = new Rect(pos, sizeDelta);
     nodeType = _type;
     m_Editor = _m_Editor;
 }