/// <summary> /// Create new chunk at the given coordinates. /// </summary> /// <param name="coords"></param> HexChunk CreateChunk(Coords coords) { HexChunk chunk = chunks[coords] = Instantiate(chunkObject, transform); chunk.world = this; return(chunk); }
public HexTile(Coords coords, HexChunk chunk) { this.coords = coords; position = chunk.world.CalculateCenter(coords); this.chunk = chunk; InitVertices(chunk.world); edges[Direction.NORTH_EAST] = new Edge(this, Direction.NORTH_EAST, chunk); edges[Direction.EAST] = new Edge(this, Direction.EAST, chunk); edges[Direction.SOUTH_EAST] = new Edge(this, Direction.SOUTH_EAST, chunk); Refresh(); }
public Edge(HexTile a, Direction dir, HexChunk chunk) { this.a = a; this.dir = dir; this.chunk = chunk; }