Esempio n. 1
0
    private void UpdateTerminator()
    {
        if ((UnityEngine.Object)terminator == (UnityEngine.Object)null)
        {
            foreach (Node node in nodes)
            {
                Type type = node.GetType();
                if (type == typeof(TerminalNodeEditor))
                {
                    if ((UnityEngine.Object)terminator == (UnityEngine.Object)null)
                    {
                        terminator = (node as TerminalNodeEditor);
                    }
                    else
                    {
                        node.Delete();
                    }
                }
            }
            if ((UnityEngine.Object)terminator == (UnityEngine.Object)null)
            {
                terminator = (TerminalNodeEditor)Node.Create("terminalNodeEditor", Vector2.zero);
            }
        }
        Vector2           position          = terminator.rect.min + new Vector2(0f, -290f);
        DisplayNodeEditor displayNodeEditor = (DisplayNodeEditor)Node.Create("displayNodeEditor", position);

        displayNodeEditor.Inputs[0].ApplyConnection(terminator.Outputs[0]);
    }
    public override NodeEditorFramework.Node Create(Vector2 pos)
    {
        DisplayNodeEditor displayNodeEditor = ScriptableObject.CreateInstance <DisplayNodeEditor>();

        displayNodeEditor.rect = new Rect(pos.x, pos.y, 266f, 301f);
        displayNodeEditor.name = "Noise Display Node";
        displayNodeEditor.CreateInput("Source Node", "IModule3D", NodeSide.Left, 40f);
        return(displayNodeEditor);
    }