示例#1
0
    IEnumerator executeWait()
    {
        StaticItems.CountDown.gameObject.SetActive(true);
        StaticItems.CountDown.text = "3";
        yield return(new WaitForSeconds(1));

        StaticItems.CountDown.text = "2";
        yield return(new WaitForSeconds(1));

        StaticItems.CountDown.text = "1";
        yield return(new WaitForSeconds(1));

        StaticItems.CountDown.text = "Start";
        //yield return new WaitForSeconds(0.5f);
        yield return(new WaitUntil(() => StaticItems.isAllChoosedDetected()));

        StaticItems.CountDown.text = "";
        StaticItems.CountDown.gameObject.SetActive(false);
        // reset score recorder and start animation
        foreach (Animator _animator in mainAnimator)
        {
            _animator.Rebind();
            if (Slider.value == 0)
            {
                Slider.value = 1.0f;
            }
            if (choosedSpeed != 0)
            {
                Slider.value = choosedSpeed;
            }
            onChangeSpeed();
            EvaluateAngle.average        = 0;
            EvaluateAngle.counter        = 0;
            EvaluateAngle.sumScore       = 0;
            StaticItems.frameCounter     = new int[10];
            StaticItems.scoresStatistics = new double[10];
        }

        started = !started;
        co      = StartCoroutine(executeTimer());
    }