// Use this for initialization void Start() { inputManager = GetComponent <TurbineInputManager>(); turbineAnim = GetComponentInChildren <TurbineAnimCtrl>(); turbineDmg = GetComponent <TurbineDamage>(); repair = GetComponent <TurbineRepair>(); turbineSpawner = GameObject.FindGameObjectWithTag("Spawner").GetComponent <TurbineSpawnManager>(); simulator = GameObject.FindGameObjectWithTag("Simulator").GetComponent <Simulation>(); gameManager = GameObject.FindGameObjectWithTag("GameManager").GetComponent <PauseGame>(); }
private bool scriptsEnabled = true; //used in the update function to minimize the times it calls the pause function. void Start() { /* "Gameobject.Find" is used cause there are many turbines gameobjects in the scene and their properties musr be inserted through script. * We use FindWithTag to improve perfomance by minimizing the searching operations. */ turbineDmg = gameObject.GetComponent <TurbineDamage>(); inputManager = gameObject.GetComponent <TurbineInputManager>(); turbineAnim = gameObject.GetComponentInChildren <TurbineAnimCtrl>(); turbineSpawner = GameObject.FindGameObjectWithTag("Spawner").GetComponent <TurbineSpawnManager>(); simulator = GameObject.FindGameObjectWithTag("Simulator").GetComponent <Simulation>(); gameManager = GameObject.FindGameObjectWithTag("Simulator").GetComponent <PauseSimulation>(); damager = GameObject.FindGameObjectWithTag("Damager").GetComponent <Damager>(); repair = gameObject.GetComponent <TurbineRepair>(); }