void Start() { GameObject controller = GameObject.FindWithTag("GameController"); GameObject tankSoundControl = GameObject.FindWithTag("TankSoundController"); GameObject airStrikeControl = GameObject.FindWithTag("AirStrikeController"); if (controller != null) { tankSoundController = tankSoundControl.GetComponent <TankSoundController>(); lifeController = controller.GetComponent <LifeController>(); consecutiveHitController = controller.GetComponent <ConsecutiveHitController>(); airStrikeController = airStrikeControl.GetComponent <AirStrikeController>(); } else { Debug.Log("Cannot find game controller"); } }
void Start() { playerCanShoot = true; playerCanMove = true; tankSoundController = GameObject.FindWithTag("TankSoundController").GetComponent <TankSoundController>(); }