Ejemplo n.º 1
0
        /// <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);
        }
Ejemplo n.º 2
0
 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();
 }
Ejemplo n.º 3
0
 public Edge(HexTile a, Direction dir, HexChunk chunk)
 {
     this.a     = a;
     this.dir   = dir;
     this.chunk = chunk;
 }