Exemple #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;
 }
Exemple #2
0
        protected override void ProcessInputs(out bool processAllOutputs)
        {
            //create projectile, only once ?
            if (projectile == null)
            {
                GameObject player = GameObject.FindGameObjectWithTag("Player");
                Vector2    direct = (Vector2)vecIn.GetData();
                float      speed  = (float)speedIn.GetData();
                projectile = Projectile.Create(direct.normalized * speed, player.transform.position, OnHitSmtg, player);
            }

            processAllOutputs = false;
        }