示例#1
0
        public void Update()
        {
            if (!displayingNumbers)
            {
                return;
            }
            displayTimer += Time.deltaTime;
            if (displayTimer > stateMachine.GetGameBlueprint().timeBetweenNumbersDisplayed)
            {
                displayTimer = 0;
                //Play sound
                stateMachine.PlaySound(AudioFiles.GameplaySoundClip.DisplayInput);
                //display number on screen
                stateMachine.TriggerHUDEvent(UIEvents.Type.PrepareCombinationNumber, stateMachine.GetCombinationNumber().ToString());
                stateMachine.TriggerHUDEvent(UIEvents.Type.DisplayCombinationNumber, CombinationDisplay.Type.Normal.ToString());
                //spawn anim number
                stateMachine.TriggerHUDEvent(UIEvents.Type.SpawnAnimNumber, stateMachine.GetCombinationNumber().ToString());

                //if the current combination count is equal to the round
                if (stateMachine.GetCurrentCombinationCount() + 1 == stateMachine.GetRound())
                {
                    displayingNumbers = false;
                    stateMachine.StartCoroutine(FadeOutNumbers());
                }
                else
                {
                    stateMachine.IncrementCombinationCount();
                }
            }
        }