void Awake() { timerText = GetComponent <Text>(); masterControllerScript = (MasterController)GameObject.Find("MasterController").GetComponent("MasterController"); gameManagerScript = (GameManager)GameObject.Find("GameManager").GetComponent("GameManager"); // Set up the inital time //gameManagerScript.curTime = gameManagerScript.maxTime; }
// Make sure to call this function first thing in StartGame() or Awake() or Start() // A reference to the GameManager and its variables is stored here along with the MasterController protected void Initialize() { gameManagerScript = (GameManager)GameObject.Find("GameManager").GetComponent("GameManager"); masterControllerScript = (MasterController)GameObject.Find("MasterController").GetComponent("MasterController"); }