Exemple #1
0
    // Use this for initialization
    void Start()
    {
        GetComponent <MeshFilter>().mesh = MeshUtility.CreateCube(1f, Vector3.zero);
        BlockManager.Init(chunkPrefab);
        TextureManager.Init(texMap, tileSize);

        for (int x = 0; x < 100; x++)
        {
            for (int y = 0; y < 100; y++)
            {
                IBlock block = new GrassBlock(Vector3.left * x + (Vector3.up * TerrainUtility.GetBlockHeight(x, y)) + Vector3.forward * y);
                for (int i = 0; i < block.Position.y; i++)
                {
                    IBlock block1 = new DirtBlock(new Vector3(block.Position.x, i, block.Position.z));
                    BlockManager.AddBlock(block1);
                }
                BlockManager.AddBlock(block);
            }
        }


        //Block block = new Block(Vector3.one);
        //BlockManager.AddBlock(block);
    }