/// <summary> /// Initialize all variables needed for this script to run. /// </summary> void Start () { timer = GetComponent<Timer>(); timer.SetLengthOfTimer(halfLength + 1); timer.Pause(); referee = GameObject.FindGameObjectWithTag("Referee").GetComponent<Referee>(); GameObject gameController = GameObject.FindGameObjectWithTag("GameController"); scoreKeeper = gameController.GetComponent<ScoreKeeper>(); ballReset = gameController.GetComponent<BallReset>(); breakTimer = GameObject.Find("BreakTimer").GetComponent<BreakTimer>(); }
/// <summary> /// Retrieve the necessary object and script references /// </summary> void Start() { GameObject gameController = GameObject.FindGameObjectWithTag("GameController"); gameTimer = gameController.GetComponent<GameTimer>(); scoreKeeper = gameController.GetComponent<ScoreKeeper>(); referee = GameObject.FindGameObjectWithTag("Referee").GetComponent<Referee>(); breakTimer = GameObject.Find("BreakTimer").GetComponent<BreakTimer>(); timer = gameObject.GetComponent<Timer>(); timer.SetLengthOfTimer(announcementPauseLength); }
/// <summary> /// Initializes all of the objects and variables needed for this script. /// </summary> void Start () { GameObject GameController = GameObject.FindGameObjectWithTag("GameController"); REF = GameObject.FindGameObjectWithTag("Referee").GetComponent<Referee>(); BR = GameController.GetComponent<BallReset>(); GT = GameController.GetComponent<GameTimer>(); BT = GameObject.Find("BreakTimer").GetComponent<BreakTimer>(); ballPossession = ball.GetComponent<Possession>(); ballLocation = ball.GetComponent<ListObjectLocation>(); timer = gameObject.AddComponent<Timer>(); timer.SetLengthOfTimer(TimerFoulTime); timer.Resume(); DeadBallTimer = gameObject.AddComponent<Timer>(); DeadBallTimer.SetLengthOfTimer(DeadBallTime); DeadBallTimer.Pause(); }