//Highlights recorded movement path for character, before confirmation. public void TargetPath(List <Vector3Int> path, HighlightTiles.TileType type) { foreach (Vector3Int l in path) { targets.ChangeTile(l, type); } }
//updates charactermap locations void InitCharacterMap() { foreach (Character e in game.enemies) { Vector3Int loc = WorldToCellSpace(e.transform.position); characterLocations[loc.x, loc.y] = e; previousCharacterLocations[e] = loc; characters.ChangeTile(loc, HighlightTiles.TileType.Enemy); } foreach (Character a in game.allies) { Vector3Int loc = WorldToCellSpace(a.transform.position); characterLocations[loc.x, loc.y] = a; previousCharacterLocations[a] = loc; characters.ChangeTile(loc, HighlightTiles.TileType.Ally); } foreach (Character o in game.obstacles) { Vector3Int loc = WorldToCellSpace(o.transform.position); characterLocations[loc.x, loc.y] = o; previousCharacterLocations[o] = loc; characters.ChangeTile(loc, HighlightTiles.TileType.None); } foreach (Character po in game.passableObstacles) { Vector3Int loc = WorldToCellSpace(po.transform.position); characterLocations[loc.x, loc.y] = po; previousCharacterLocations[po] = loc; characters.ChangeTile(loc, HighlightTiles.TileType.None); } }
//unhighlihgts a tile, currently used to make self an invalid target. public void UnHighlight(Vector3 pos) { Vector3Int location = WorldToCellSpace(pos); highlights.ChangeTile(location, HighlightTiles.TileType.None); }