void Start() { spawn = true; StartCoroutine("Spawning"); timer = GameObject.FindGameObjectWithTag("Game Manager").GetComponent<Timer>(); powerUpLocation = GameObject.FindGameObjectWithTag("Game Manager").GetComponent<PowerUpLocationManager>(); }
void Start() { units = GetComponent<TDEnemy>(); nextTarget = new Queue<Transform>(); turretCtrl = GetComponentInChildren<TankTurretControl>(); GameObject gameManager = GameObject.FindGameObjectWithTag("Game Manager"); timer = gameManager.GetComponent<Timer>(); powerUpLocationManager = gameManager.GetComponent<PowerUpLocationManager>(); }
void Start() { maxRotationSpd = 6f; accelerationLookingSpd = 2.5f; enemyFirePos = new Vector3(); units = GetComponent<TDEnemy>(); animator = GetComponent<Animator>(); audio = GetComponent<AudioSource>(); rigidbody = GetComponent<Rigidbody>(); timer = GameObject.FindGameObjectWithTag("Game Manager").GetComponent<Timer>(); powerUpLocationManager = GameObject.FindGameObjectWithTag("Game Manager").GetComponent<PowerUpLocationManager>(); //Destroy Invisible Objects Debug.Log("Soldiers: "+soldiers.Length); /*for(int i=0; i<soldiers.Length; i++){ Destroy(soldiers[i]); } Debug.Log(soldiers.Length); */ }