Esempio n. 1
0
    IEnumerator StartAttack(SquadControl targetSquad)
    {
        int[] normalOrder = new int[6] {
            0, 1, 2, 3, 1, 0
        };
        int[] mixedOrder = new int[6] {
            1, 0, 3, 2, 1, 0
        };

        int[] order = Random.value > 0.5f ? normalOrder : mixedOrder;

        for (int i = 0; i < 6; i++)
        {
            UnitControl unit = units[order[i]];
            if (unit && unit.Attack(targetSquad, (i < 4)))
            {
                yield return(new WaitForSeconds(0.5f));
            }
        }
    }