示例#1
0
    private IEnumerator StartBattleCoroutine()
    {
        Game.Instance.CameraContainer.GetComponent <Tweener>().PlayTween();
        infoBox.ClearText();
        ShowHideLines(true);
        healthMenu.PlayTween();

        foreach (CharacterBase character in playerParty.characters)
        {
            AddCharacterToBattle(character);
        }

        enemySpawner.SpawnNewFormation(Vector3.right * enemySpawnOffset);
        SetupPartyEnemy();
        yield return(new WaitForSecondsRealtime(waitBetweenEnter / 2));

        foreach (CharacterBase character in enemyParty.characters)
        {
            AddCharacterToBattle(character);
            infoBox.EnemyEnterText(character);
            yield return(new WaitForSecondsRealtime(waitBetweenEnter));
        }

        List <CharacterBase> characters = GetCharacterList();

        turnOrder = new List <CharacterBase>();
        turnOrder = characters.OrderByDescending(x => Calculator.GetStat(x.stats.speed, x.Faction == Faction.Player ? playerParty.Level : enemyParty.Level)).ToList();
        turnIndex = 0;
        NextTurn(true);

        filler.FillCurrentTurn();
        yield return(null);
    }