예제 #1
0
        protected static void ReassignOutputType(ref NodeOutput output, Type newOutputType)
        {
            Node   body = output.body;
            string name = output.name;
            IEnumerable <NodeInput> enumerable = from connection in output.connections
                                                 where connection.typeData.Type.IsAssignableFrom(newOutputType)
                                                 select connection;

            output.Delete();
            NodeEditorCallbacks.IssueOnAddNodeKnob(NodeOutput.Create(body, name, newOutputType.AssemblyQualifiedName));
            output = body.Outputs[body.Outputs.Count - 1];
            foreach (NodeInput item in enumerable)
            {
                item.ApplyConnection(output);
            }
        }
예제 #2
0
        /// <summary>
        /// Reassigns the type of the given output. This actually recreates it
        /// </summary>
        protected static void ReassignOutputType(ref NodeOutput output, Type newOutputType)
        {
            Node   body       = output.body;
            string outputName = output.name;
            // Store all valid connections that are not affected by the type change
            IEnumerable <NodeInput> validConnections = output.connections.Where((NodeInput connection) => connection.typeData.Type.IsAssignableFrom(newOutputType));

            // Delete the output of the old type
            output.Delete();
            // Create Output with new type
            NodeEditorCallbacks.IssueOnAddNodeKnob(NodeOutput.Create(body, outputName, newOutputType.AssemblyQualifiedName));
            output = body.Outputs[body.Outputs.Count - 1];
            // Restore the valid connections
            foreach (NodeInput input in validConnections)
            {
                input.ApplyConnection(output);
            }
        }
예제 #3
0
 /// <summary>
 /// Creates and output on this Node of the given type at the specified NodeSide and position.
 /// </summary>
 public void CreateOutput(string outputName, string outputType, NodeSide nodeSide, float sidePosition)
 {
     NodeOutput.Create(this, outputName, outputType, nodeSide, sidePosition);
 }
예제 #4
0
 /// <summary>
 /// Creates and output on this Node of the given type at the specified NodeSide.
 /// </summary>
 public void CreateOutput(string outputName, string outputType, NodeSide nodeSide)
 {
     NodeOutput.Create(this, outputName, outputType, nodeSide);
 }
예제 #5
0
 /// <summary>
 /// Creates and output on this Node of the given type at the specified NodeSide and position.
 /// </summary>
 public NodeOutput CreateOutput(string outputName, string outputType, NodeSide nodeSide, float sidePosition)
 {
     return(NodeOutput.Create(this, outputName, outputType, nodeSide, sidePosition));
 }
예제 #6
0
 /// <summary>
 /// Creates and output on this Node of the given type at the specified NodeSide.
 /// </summary>
 public NodeOutput CreateOutput(string outputName, string outputType, NodeSide nodeSide)
 {
     return(NodeOutput.Create(this, outputName, outputType, nodeSide));
 }