Пример #1
0
    public IEnumerator BeginRoundCoroutine()
    {
        List <CommandsManager.CommandType> nextMoves = new List <CommandsManager.CommandType>();

        for (int i = 0; i < 5; i++)
        {
            nextMoves = CommandsManager.generateMoves(_round.Count);
            if (nextMoves[0] != _lastCommand && nextMoves[0] != CommandsManager.CommandType.TwoFingerTap && nextMoves[0] != CommandsManager.CommandType.TwoFingerLongTap)
            {
                break;
            }
        }

        int variation = 1;

        if (_round.Count > 10)
        {
            variation = Random.Range(1, 5); //4+1
        }

        _player.StartRound(nextMoves, variation);
        _lastCommand = nextMoves[0];
        yield return(null);

        _round.IsActive = true;
    }
Пример #2
0
    public IEnumerator BeginRoundCoroutine()
    {
        _timeBar.SignalGetReady();
        _roundNumberText.RoundCountChange(_round.Count);
        yield return(new WaitForSeconds(1f));

        _roundNumberText.ClearText();

        List <CommandsManager.CommandType> nextMoves = new List <CommandsManager.CommandType>();

        for (int i = 0; i < 5; i++)
        {
            nextMoves = CommandsManager.generateMoves(_round.Count);
            if (nextMoves[0] != _lastCommand && nextMoves[0] != CommandsManager.CommandType.TwoFingerTap && nextMoves[0] != CommandsManager.CommandType.TwoFingerLongTap)
            {
                break;
            }
        }

        int variation = 1;

        if (_round.Count > 10)
        {
            variation = Random.Range(1, 5); //4+1
        }

        _player.StartRound(nextMoves, variation);
        _lastCommand = nextMoves[0];
        yield return(new WaitForSeconds(0.6f));

        _timeBar.StartRound(_roundTime);
        _round.IsActive = true;
    }
Пример #3
0
    public IEnumerator BeginRoundCoroutine()
    {
        _round.Duration = _roundTime;
        _timeBar.SignalGetReady();
        _roundNumberText.RoundCountChange(_round.Count);
        yield return(new WaitForSeconds(1f));

        _roundNumberText.ClearText();

        List <CommandsManager.CommandType> nextMoves = new List <CommandsManager.CommandType>();

        for (int i = 0; i < 5; i++)
        {
            nextMoves = CommandsManager.generateMoves(_round.Count);
            if (nextMoves[0] != _lastCommand && nextMoves[0] != CommandsManager.CommandType.TwoFingerTap && nextMoves[0] != CommandsManager.CommandType.TwoFingerLongTap)
            {
                break;
            }
        } // генерація доступних для наступного раунду рухів

        int variation = 1; // один з варіантів завдання для гравця

        if (_round.Count > 10)
        {
            variation = Random.Range(1, 5); //4+1
        }

        _firstPlayer.StartRound(nextMoves, variation);
        _secondPlayer.StartRound(nextMoves, variation);

        _lastCommand = nextMoves[0];
        yield return(new WaitForSeconds(0.6f));

        _timeBar.StartRound(_roundTime);
        _round.IsActive = true;
    }