Beispiel #1
0
    public IEnumerator ExecuteUnitCommands()
    {
        List <Vector2Int> oldUnitTiles = new List <Vector2Int>(unitTiles);

        foreach (Vector2Int tile in oldUnitTiles)
        {
            UnitScript unitScript = tiles[tile.x, tile.y].unitScript;
            if (unitScript.commands.Count > 0)
            {
                StartCoroutine(unitScript.ExecuteCommands());
                while (!unitScript.doneMoving)
                {
                    yield return(null);
                }
                yield return(new WaitForSeconds(0.5f));
            }
        }

        turnScript.doneWithUnits = true;
    }