IEnumerator Countdown(string nextCoroutine = "") { yield return(new WaitForSeconds(2f)); if (animateCanvases) { canvasesAnim.SetBool("up", true); animateCanvases = false; } CountDownManager.Three(); yield return(new WaitForSeconds(1f)); CountDownManager.Two(); yield return(new WaitForSeconds(1f)); CountDownManager.One(); yield return(new WaitForSeconds(1f)); CountDownManager.Go(); ScoreKeeper.isGameRunning = true; if (nextCoroutine != "") { StartCoroutine(nextCoroutine); } }
//public delegate void TriggerGameOver(); //public TriggerGameOver GameOverTrigger; // Start is called before the first frame update void Start() { Instance = this; TimerNum = GetComponent <Text>(); CountDownTimer.GetInstance().CountDown("main_timer", 60f, (t) => { TimerNum.text = string.Format("{0:0}", t); }, () => { Debug.Log("time is up"); if (ScoreManager.Instance.GetScore() > 70) { Game.GetInstance().ToHighScore(); //SceneManager.LoadScene("HighScore"); } else if (ScoreManager.Instance.GetScore() < 30) { Game.GetInstance().ToLowScore(); //SceneManager.LoadScene("LowScore"); } else { Game.GetInstance().ToMidScore(); //SceneManager.LoadScene("MidScore"); } CountDownTimer.GetInstance().ClearAllTimers(); }); }
private void Awake() { _highScoreManager = Object.FindObjectOfType <HighScoreManager>(); _countDownManager = Object.FindObjectOfType <CountDownManager>(); _trueFalseManager = Object.FindObjectOfType <TrueFalseManager>(); _timerManager = Object.FindObjectOfType <TimerManager>(); _circlesManager = Object.FindObjectOfType <CirclesManager>(); _audioSource = GetComponent <AudioSource>(); }
void Awake() { cdm = GameObject.Find("CountDownManager").GetComponent <CountDownManager>(); }