コード例 #1
0
        void Start()
        {
            meshFilter       = GetComponent <MeshFilter>();
            meshCollider     = GetComponent <MeshCollider>();
            voxelMeshBuilder = GameManager.Instance.GetVoxelMeshBuilder();

            chunk = new Chunk(sizeX, sizeY, sizeZ);
            chunk.SetVoxel(0, 0, 0, Voxel.Type.Solid, Color.black);
            chunk.SetVoxel(1, 0, 0, Voxel.Type.Solid, Color.black);

            MeshData meshData = voxelMeshBuilder.BuildMesh(chunk);

            voxelMeshBuilder.RenderMesh(meshData, meshFilter, meshCollider);
        }
コード例 #2
0
 void InitGame()
 {
     voxelMeshBuilder = GameObject.Find("/Managers/VoxelMeshBuilder").GetComponent <VoxelMeshBuilder>();
     colorTexture     = GameObject.Find("/Managers/ColorTexture").GetComponent <ColorTexture>();
 }