示例#1
0
    private IEnumerator StartGameCoroutine()
    {
        _player1LegsController.StepToPosition(true, true);
        _player2LegsController.StepToPosition(true, true);
        yield return(new WaitForSeconds(2f));

        _player1Bubble.Show();
        yield return(new WaitForSeconds(1f));

        _player2Bubble.Show();
        yield return(new WaitForSeconds(1f));

        _currentSequence.Start(OnGameplaySequenceFinished);
    }
示例#2
0
    private IEnumerator SequenceEndCoroutine(GameplaySequence sequence)
    {
        GameplaySequence sequenceToPlay = null;


        if (sequence.Success)
        {
            Debug.Log("Sequence " + sequence.RequiredScore.ToString() + " won.");
            Dialogue dialogue = GetRandomPositiveDialogue();
            yield return(StartCoroutine(DisplayBoardTextCoroutine(sequence.StartingBoard, dialogue.Sentence, true)));

            yield return(StartCoroutine(DisplayBoardTextCoroutine(sequence.OtherBoard, dialogue.Answer, true)));
        }
        else
        {
            Debug.Log("Sequence " + sequence.RequiredScore.ToString() + " lost.");
            Dialogue dialogue = GetRandomNegativeDialogue();
            yield return(StartCoroutine(DisplayBoardTextCoroutine(sequence.StartingBoard, dialogue.Sentence, false)));

            yield return(StartCoroutine(DisplayBoardTextCoroutine(sequence.OtherBoard, dialogue.Answer, false)));
        }


        LegsController legsToMove = sequence.Success ? GetLowestProgressPlayer() : GetHighestProgressPlayer();

        legsToMove.StepToPosition(sequence.Success, false);

        while (sequence.Legs.IsMoving)
        {
            yield return(null);
        }

        _currentSequence = GetNextSequence();

        if (_currentSequence != null)
        {
            _currentSequence.Start(OnGameplaySequenceFinished);
        }
        else
        {
            EndGame(sequence.Success);
        }
    }