示例#1
0
        protected static void ReassignInputType(ref NodeInput input, Type newInputType)
        {
            Node   body      = input.body;
            string inputName = input.name;
            // Store the valid connection if it's not affected by the type change
            NodeOutput validConnection = null;

            if (input.connection != null && newInputType.IsAssignableFrom(input.connection.typeData.Type))
            {
                validConnection = input.connection;
            }
            // Delete the input of the old type
            input.Delete();
            // Create Output with new type
            NodeEditorCallbacks.IssueOnAddNodeKnob(NodeInput.Create(body, inputName, newInputType.AssemblyQualifiedName));
            input = body.Inputs[body.Inputs.Count - 1];
            // Restore the valid connections
            if (validConnection != null)
            {
                input.ApplyConnection(validConnection);
            }
        }
示例#2
0
 public NodeInput CreateInput(string inputName, string inputType, NodeSide nodeSide, float sidePosition)
 {
     return(NodeInput.Create(this, inputName, inputType, nodeSide, sidePosition));
 }
示例#3
0
 public NodeInput CreateInput(string inputName, string inputType, NodeSide nodeSide)
 {
     return(NodeInput.Create(this, inputName, inputType, nodeSide));
 }