Beispiel #1
0
    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;
    }
Beispiel #2
0
    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();
        }
    }
Beispiel #3
0
    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();
     }
 }
Beispiel #5
0
 public void Select()
 {
     Selected = true;
     if (TimersAllowed)
     {
         ButtonTimer.StartTimer();
     }
 }
Beispiel #6
0
 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);
 }
Beispiel #7
0
 void Start()
 {
     _UITimer.StartTimer(() => {
         _resultUI.show(_resultPhoto.bestPhotoTexture, _resultPhoto.bestPhotoScores);
     });
 }
Beispiel #8
0
 void ResetCountDown()
 {
     countDown.StartTimer();
     countDown.StartIntervalTimer(time);
 }