void Start() { gameController = GameObject.FindWithTag("GameController").GetComponent <GameController>(); enemyController = GameObject.FindWithTag("EnemyController").GetComponent <EnemyController>(); invaderMovement = GetComponent <InvaderMovement>(); deadClipSource = GetComponent <AudioSource>(); }
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 }
// Use this for initialization void Start() { invMove = GameObject.Find("Space Invader Start").GetComponent("InvaderMovement") as InvaderMovement; movingLeft = true; }