Beispiel #1
0
        private void SetupWalkableTileList(Unit unit)
        {
            ClearWalkableTileList();
            byte[,] grid = _tileMap.GetCostGrid(TerrainToCost);
            List <Tile> newList = AStar.GetTilesInRange(grid, unit.tile, 5);

            for (int i = 0; i < newList.Count; i++)
            {
                if (newList[i].unit == null)
                {
                    walkableTileList.Add(newList[i]);
                    newList[i].SetState(_TileState.Walkable);
                }
            }
            //SetupHostileInRangeforTile(unit, walkableTileList);
        }