private IEnumerator DeliveryTimer() { coroutineRunning = true; bool soundHasPlayed = false; uiElement.StartTimer(deliveryTime); float timer = 0f; while (timer < deliveryTime && onCooldown == false) { timer += Time.deltaTime; if (!soundHasPlayed && timer / deliveryTime >= 0.7f) { if (Time.timeScale == 0) { StopAllCoroutines(); } AudioController.Instance.GenerateAudio(AudioController.ClipName.IsCloseToCrying, transform.position, nearCrying); soundHasPlayed = true; } yield return(null); } PointHandeler.FailedDelivery(negativePoint); StartCoroutine(FailureDelay()); AudioController.Instance.GenerateAudio(AudioController.ClipName.Crying, transform.position, crying); ParticleSpawner.SpawnParticleEffect(ParticleSpawner.Particles.Crying, particlePoint.position); coroutineRunning = false; }
private void CheckPlayerReady() { isAllReady = true; foreach (PlayerScoreCard card in playerCards) { if (!card.isReady) { isAllReady = false; break; } } if (isAllReady) { if (!timer.isRunning) //Start start-coroutine { countdownModule.SetActive(true); timer.StartTimer(startGameTime, () => { Debug.Log("START GAME"); GameManager.LoadNextLevel(); }); //This is where we start next game } } else { //Stop start-coroutine countdownModule.SetActive(false); timer.StopTimer(); } }
private void Update() { bool isAllReady = false; if (nOReadySwitches > 0 && nOReadySwitches == GameManager.Players.Length) { isAllReady = true; } countdownModule.SetActive(isAllReady); if (isAllReady) { if (!countdownTimer.isRunning) //Start start-coroutine { countdownModule.SetActive(true); countdownTimer.StartTimer(readyStartTime, () => { Debug.Log("START GAME"); SaveAllHybridModels(); GameManager.LoadNextLevel(); }); //This is where we start next game } } else { //Stop start-coroutine countdownModule.SetActive(false); countdownTimer.StopTimer(); } }
public void Reset() { if (SequenceTimerAllowed) { SequenceTimer.ResetTimer(); SequenceTimer.StartTimer(); } }
public void Select() { Selected = true; if (TimersAllowed) { ButtonTimer.StartTimer(); } }
void Awake() { openTime = Time.time; mutualExclusion = false; Layer = GUIZLayer.TIP + 200; showTime.StartTimer(); if (GameCenter.instance.IsConnected) { NetMsgMng.ConectClose(); } UIEventListener.Get(goBackBtn).onClick += OnBtnPassWord; showTime.StartIntervalTimer((int)limitTime); }
void Start() { _UITimer.StartTimer(() => { _resultUI.show(_resultPhoto.bestPhotoTexture, _resultPhoto.bestPhotoScores); }); }
void ResetCountDown() { countDown.StartTimer(); countDown.StartIntervalTimer(time); }