Ejemplo n.º 1
0
        protected internal override void ClearConnection()
        {
            if (connection == null)
            {
                return;
            }
            var temp = connection;

            connection = null;
            temp.ClearConnection();
        }
Ejemplo n.º 2
0
 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;
 }
Ejemplo n.º 3
0
        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);
        }
Ejemplo n.º 4
0
 public T GetValue <T>()
 {
     return(connection != null?connection.GetValue <T>() : NodeOutput.GetDefault <T>());
 }
Ejemplo n.º 5
0
 public NodeOutput CreateNodeOutput(string outputName, string outputType, Side sd, float offset, string fieldName)
 {
     return(NodeOutput.Create(this, outputName, outputType, sd, offset, fieldName));
 }
Ejemplo n.º 6
0
 public NodeOutput CreateNodeOutput(string outputName, string outputType, Side sd)
 {
     return(NodeOutput.Create(this, outputName, outputType, sd));
 }
Ejemplo n.º 7
0
 private static void SetKnobUI(NodeOutput output)
 {
     output.texture2D = EffectUtility.Tex(Color.blue);
 }