public override IEnumerator Traverse(WorldTile tile) //again, for animation (use coroutines) { unit.Place(tile); // Build a list of way points from the unit's // starting tile to the destination tile List <WorldTile> targets = new List <WorldTile>(); while (tile != null) { targets.Insert(0, tile); tile = tile.prev; } // Move to each way point in succession for (int i = 1; i < targets.Count; ++i) { WorldTile from = targets[i - 1]; WorldTile to = targets[i]; Directions dir = from.GetDirection(to); if (unit.dir != dir) { yield return(StartCoroutine(Turn(dir))); } yield return(StartCoroutine(Walk(to))); } yield return(null); }