コード例 #1
0
        public static NodeOutput Create(Node nodeBody, string outputName, string outputType, Side sd = Side.Bottom, float offset = 0)
        {
            NodeOutput output = CreateInstance <NodeOutput>();

            output.outputType = outputType;
            offset            = offset + 20;
            output.Init(nodeBody, outputName, sd, offset);
            SetKnobUI(output);
            nodeBody.outputKnobs.Add(output);
            output.Body = nodeBody;
            return(output);
        }
コード例 #2
0
 private static void SetKnobUI(NodeOutput output)
 {
     if (output.Name.Contains("Nextout"))
     {
         output.texture2D = OuUIUtility.Tex(Color.black);
     }
     else if (output.Name.Contains("Forout"))
     {
         output.texture2D = OuUIUtility.Tex(Color.blue);
     }
     else
     {
         output.texture2D = OuUIUtility.Tex(Color.green);
     }
 }
コード例 #3
0
 public T GetValue <T>()
 {
     return(connection != null?connection.GetValue <T>() : NodeOutput.GetDefault <T>());
 }
コード例 #4
0
 public static void Linking(NodeOutput output, NodeInput input)
 {
     output.connections.Add(input);
     input.connection = output;
 }
コード例 #5
0
 public NodeOutput CreateNodeOutput(string outputName, string outputType, Side sd, float offset)
 {
     return(NodeOutput.Create(this, outputName, outputType, sd, offset));
 }
コード例 #6
0
 public NodeOutput CreateNodeOutput(string outputName, string outputType, Side sd)
 {
     return(NodeOutput.Create(this, outputName, outputType, sd));
 }