예제 #1
0
 void Start()
 {
     gameController  = GameObject.FindWithTag("GameController").GetComponent <GameController>();
     enemyController = GameObject.FindWithTag("EnemyController").GetComponent <EnemyController>();
     invaderMovement = GetComponent <InvaderMovement>();
     deadClipSource  = GetComponent <AudioSource>();
 }
예제 #2
0
 public void Attack(GameObject attackingPlanet, GameObject defendingPlanet)
 {
     SpawnInvaders(attackingPlanet, defendingPlanet);//Spawn Invaders
     foreach (Transform transform in InvaderList)
     {
         InvaderMovement invaderScript = transform.GetComponent <InvaderMovement>();
         invaderScript.TargetWorld = defendingPlanet;
         invaderScript.HomeWorld   = attackingPlanet;
         invaderScript.Attack      = true;
     }
     InvaderList.Clear();//Clear List
 }
예제 #3
0
 // Use this for initialization
 void Start()
 {
     invMove    = GameObject.Find("Space Invader Start").GetComponent("InvaderMovement") as InvaderMovement;
     movingLeft = true;
 }