Пример #1
0
 internal override void PartialSetup()
 {
     if (input.GetDataType() != null)
     {
         if (output == null)
         {
             //create the output
             output = new AnyTypeOutput(this, input.GetDataType());
             outputs.Add(output);
         }
         else
         {
             //update the output
             if (input.GetDataType() != output.GetDataType())
             {
                 output.SetDataType(input.GetDataType());
             }
         }
     }
     else
     {
         //delete the output
         if (output != null)
         {
             outputs.Clear();
             output = null;
         }
     }
 }
Пример #2
0
 internal override void PartialSetup()
 {
     if (in1.GetDataType() == null)
     {
         //nothing plugged in
         //hide the output
         oldType   = null;
         outResult = null;
         outputs.Clear();
     }
     else
     {
         if (in1.GetDataType() != oldType)
         {
             oldType = in1.GetDataType();
             //if the data type in input 1 changed
             //change/create output
             if (outResult == null)
             {
                 //create output adapted to in type
                 outResult = new AnyTypeOutput(this, in1.GetDataType());
                 outputs.Add(outResult);
             }
             else
             {
                 //update output for in type
                 outResult.SetDataType(in1.GetDataType());
             }
         }
     }
 }
Пример #3
0
 public void UpdateOutputs()
 {
     SortOuts();
     for (int i = 0; i < groupOuts.Count; i++)
     {
         if (outputs.Count > i)
         {
             //update current output
             AnyTypeOutput   outp = (AnyTypeOutput)outputs[i];
             GroupOutputNode node = (GroupOutputNode)groupOuts[i].node;
             outp.SetDataType(node.inp.GetDataType());
         }
         else
         {
             //create new output
             Debug.Log("creating new output");
             GroupOutputNode node = (GroupOutputNode)groupOuts[i].node;
             AnyTypeOutput   outp = new AnyTypeOutput(this, node.inp.GetDataType());
             outputs.Add(outp);
         }
     }
     //supprime les autres output
     while (outputs.Count > groupOuts.Count)
     {
         outputs.RemoveAt(groupOuts.Count);
     }
 }
Пример #4
0
        public override void BeginSetup()
        {
            in1  = new MultiDataInput(this, new List <Type>(new Type[] { typeof(Vector2), typeof(Vector3), typeof(float) }));
            in2  = new MultiDataInput(this, new List <Type>(new Type[] { typeof(Vector2), typeof(Vector3), typeof(float) }));
            outp = new AnyTypeOutput(this, typeof(object));

            inputs.Add(in1);
            inputs.Add(in2);
        }
Пример #5
0
        public override void BeginSetup()
        {
            inp               = new MultiDataInput(this, new List <Type>(new Type[] { typeof(Vector2) }));
            outp              = new AnyTypeOutput(this, typeof(Vector2));
            outp.onConnect    = OnOutputChange;
            outp.onDisconnect = OnOutputChange;

            inputs.Add(inp);
            outputs.Add(outp);
            SetVariableName("");
            //ya pas d'output tant que c'est pas un nom de variable valid
        }
Пример #6
0
 public void SetDataType(Type t)
 {
     dataType = t;
     if (outp == null)
     {
         outp = new AnyTypeOutput(this, t);
         outputs.Add(outp);
     }
     else
     {
         outp.SetDataType(t);
     }
 }