コード例 #1
0
 protected override void ProcessInputs(out bool processAllOutputs)
 {
     if (in1.GetDataType() == typeof(float))
     {
         //multiply 2 float
         float v = (float)in1.GetData();
         float m = (float)inMult.GetData();
         outResult.SetData(v * m);
     }
     else if (in1.GetDataType() == typeof(Vector2))
     {
         //multiply vector2 and float
         Vector2 v = (Vector2)in1.GetData();
         float   m = (float)inMult.GetData();
         outResult.SetData(v * m);
     }
     else if (in1.GetDataType() == typeof(Vector3))
     {
         //multiply vec3 and float
         Vector3 v = (Vector3)in1.GetData();
         float   m = (float)inMult.GetData();
         outResult.SetData(v * m);
     }
     processAllOutputs = true;
 }
コード例 #2
0
        internal override void PartialSetup()
        {
            if (inX.GetDataType() == null)
            {
                checkManuallyX = true;
            }
            else
            {
                checkManuallyX = false;
            }

            if (inY.GetDataType() == null)
            {
                checkManuallyY = true;
            }
            else
            {
                checkManuallyY = false;
            }

            if (inZ.GetDataType() == null)
            {
                checkManuallyZ = true;
            }
            else
            {
                checkManuallyZ = false;
            }
        }
コード例 #3
0
 protected override void ProcessInputs(out bool processAllOutputs)
 {
     if (in1.GetDataType() == typeof(Vector2))
     {
         //vector2
         Vector2 vect = (Vector2)in1.GetData();
         x.SetData(vect.x);
         y.SetData(vect.y);
         magn.SetData(vect.magnitude);
     }
     else
     {
         //vector3
         Vector3 vect = (Vector3)in1.GetData();
         x.SetData(vect.x);
         y.SetData(vect.y);
         z.SetData(vect.z);
         magn.SetData(vect.magnitude);
     }
     processAllOutputs = true;
 }
コード例 #4
0
ファイル: AddNode.cs プロジェクト: r2d2m/NodeGame
 protected override void ProcessInputs(out bool processAllOutputs)
 {
     if (in1.GetDataType() == typeof(Vector2))
     {
         //vec2
         Vector2 vec1 = (Vector2)in1.GetData();
         Vector2 vec2 = (Vector2)in2.GetData();
         outp.SetData(Vec2Operation(vec1, vec2));
     }
     else if (in1.GetDataType() == typeof(Vector3))
     {
         //vec3
         Vector3 vec1 = (Vector3)in1.GetData();
         Vector3 vec2 = (Vector3)in2.GetData();
         outp.SetData(Vec3Operation(vec1, vec2));
     }
     else if (in1.GetDataType() == typeof(float))
     {
         //float
         float f1 = (float)in1.GetData();
         float f2 = (float)in2.GetData();
         outp.SetData(FloatOperation(f1, f2));
     }
     else
     {
         Debug.LogError("type f****d in the butt, this shouldn't happen (AddNode)");
     }
     processAllOutputs = true;
 }
コード例 #5
0
ファイル: WaitNode.cs プロジェクト: r2d2m/NodeGame
 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;
         }
     }
     if (inTime.GetDataType() == null)
     {
         checkManually = true;
     }
     else
     {
         checkManually = false;
     }
 }