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); }
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); } }
public T GetValue <T>() { return(connection != null?connection.GetValue <T>() : NodeOutput.GetDefault <T>()); }
public static void Linking(NodeOutput output, NodeInput input) { output.connections.Add(input); input.connection = output; }
public NodeOutput CreateNodeOutput(string outputName, string outputType, Side sd, float offset) { return(NodeOutput.Create(this, outputName, outputType, sd, offset)); }
public NodeOutput CreateNodeOutput(string outputName, string outputType, Side sd) { return(NodeOutput.Create(this, outputName, outputType, sd)); }