protected internal override void ClearConnection() { if (connection == null) { return; } var temp = connection; connection = null; temp.ClearConnection(); }
public override void Linking(NodeKnob other) { base.Linking(other); if (other.GetType() != typeof(NodeOutput)) { return; } other.ClearConnection(); ClearConnection(); connection = other as NodeOutput; (other as NodeOutput).connection = this; }
public static NodeOutput Create(Node nodeBody, string outputName, string outputType, Side sd = Side.Right, float offset = 0, string field = "") { NodeOutput output = CreateInstance <NodeOutput>(); #if UNITY_EDITOR Undo.RegisterCreatedObjectUndo(output, "Create Node"); #endif output.outputType = outputType; offset = offset + 20; output.Init(nodeBody, outputName, sd, offset); SetKnobUI(output); nodeBody.outputKnobs.Add(output); output.Body = nodeBody; output.BindFieldName = field; output.CotName = field; return(output); }
public T GetValue <T>() { return(connection != null?connection.GetValue <T>() : NodeOutput.GetDefault <T>()); }
public NodeOutput CreateNodeOutput(string outputName, string outputType, Side sd, float offset, string fieldName) { return(NodeOutput.Create(this, outputName, outputType, sd, offset, fieldName)); }
public NodeOutput CreateNodeOutput(string outputName, string outputType, Side sd) { return(NodeOutput.Create(this, outputName, outputType, sd)); }
private static void SetKnobUI(NodeOutput output) { output.texture2D = EffectUtility.Tex(Color.blue); }