private void Update() { if (TimeEnd) { return; } timeLeft -= Time.deltaTime; timerClockScript.UpdateClock(timeLeft); if (Mathf.RoundToInt(timeLeft) <= 0) { timeLeft = 0; TimeEnd = true; TheEnd(); } TimerT.text = Mathf.RoundToInt(timeLeft).ToString(); }
// Update is called once per frame void Update() { if (!TimeEnd) { playTime -= Time.deltaTime; timerClockScript.UpdateClock(playTime); Timer.text = Mathf.RoundToInt(playTime).ToString(); if (playTime <= 0) { TimeEnd = true; Spawn = false; StartCoroutine(Ending()); } } if (!Spawn) { return; } Spawn = false; IL.SetSortable(Instantiate(Thing, new Vector3(0, 0, -1), Quaternion.identity)); }