예제 #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;
    }
예제 #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();
        }
    }
예제 #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();
        }
    }
예제 #4
0
 public void Reset()
 {
     if (SequenceTimerAllowed)
     {
         SequenceTimer.ResetTimer();
         SequenceTimer.StartTimer();
     }
 }
예제 #5
0
 public void Select()
 {
     Selected = true;
     if (TimersAllowed)
     {
         ButtonTimer.StartTimer();
     }
 }
예제 #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);
 }
예제 #7
0
 void Start()
 {
     _UITimer.StartTimer(() => {
         _resultUI.show(_resultPhoto.bestPhotoTexture, _resultPhoto.bestPhotoScores);
     });
 }
예제 #8
0
 void ResetCountDown()
 {
     countDown.StartTimer();
     countDown.StartIntervalTimer(time);
 }