Ejemplo n.º 1
0
    public void SpawnOne(int meteorType, Vector3 pos)
    {
        GameObject      newMeteor = Instantiate(Meteorites[meteorType], pos, Quaternion.identity);
        MeteorBehaviour mScript   = newMeteor.GetComponent <MeteorBehaviour>();

        mScript.newSpawned = true;
        mScript.StartingVelocity(-pos);
    }
Ejemplo n.º 2
0
 void SplitAttack(Transform otherPos)
 {
     SpawnDestroyEffect();
     if (meteorLevel != 0)
     {
         GameObject newMeteor0 = Instantiate(meteorSubtype, transform.position + otherPos.transform.right * dist, Quaternion.identity);
         GameObject newMeteor1 = Instantiate(meteorSubtype, transform.position + otherPos.transform.right * -dist, Quaternion.identity);
         newMeteor0.transform.position = new Vector3(transform.position.x, 0, transform.position.z);
         newMeteor1.transform.position = new Vector3(transform.position.x, 0, transform.position.z);
         MeteorBehaviour nM0     = newMeteor0.GetComponent <MeteorBehaviour>();
         MeteorBehaviour nM1     = newMeteor1.GetComponent <MeteorBehaviour>();
         Vector3         combDir = otherPos.gameObject.GetComponent <Rigidbody>().velocity;
         nM0.StartingVelocity(myRB.velocity);
         nM1.StartingVelocity(combDir);
     }
 }