Example #1
0
        public void init()
        {
            this.gameObject = new GameObject("Layer: Add layer name here!");
            this.gameObject.transform.parent = this.parent.transform;

            // Create the chunks


            for (uint i = 0; i < (this.layerDimensions / this.chunkSize); ++i)
            {
                for (uint p = 0; p < (this.layerDimensions / this.chunkSize); ++p)
                {
                    TileChunk chunk = this.addChunk(new TileChunk(this.chunkSize, (uint)subMeshSize));
                    chunk.position = new Vector3((p * this.chunkSize),
                                                 (i * this.chunkSize),
                                                 (0));

                    chunk.init();
                    chunk.updateBuffer();
                }
            }
        }
Example #2
0
 public TileChunk addChunk(TileChunk chunk)
 {
     chunk.setParent(this);
     this.chunks.Add(chunk);
     return(chunk);
 }