public static void SetTowerForLevelMap(Tower tower, Tile tile) { tile.SetBlockableObject(tower); //UpdateTilePaths(); List<Tile> walkableNeighbors = GetWalkableNeighbors(tile); for (int i = 0; i < walkableNeighbors.Count; i++) { walkableNeighbors[i].RegisterTowerListener(tower); } //OnTowerCreated(); }
public static bool SetTower(Tower tower, Tile tile) { tile.SetBlockableObject(tower); if (IsTilePathsValid()) { UpdateTilePaths(); List<Tile> walkableNeighbors = GetWalkableNeighbors(tile); for (int i = 0; i < walkableNeighbors.Count; i++) { walkableNeighbors[i].RegisterTowerListener(tower); } OnTowerCreated(); return true; } RemoveTower(tile); return false; }