Example #1
0
    private void ReloadMesh(GameObject previewRendererObject, BlockType block)
    {
        if (previewRendererObject == null)
        {
            return;
        }

        var mesh = ChunkFactory.Build(block);

        previewRendererObject.GetComponent <MeshFilter>().mesh = mesh;
    }
Example #2
0
    public void Edit(Vector3Int coord, BlockType type)
    {
        if (!Blocks.Contains(coord.x, coord.y, coord.z) || Blocks.Blocks[coord.x, coord.y, coord.z] == type)
        {
            return;
        }

        Blocks.Blocks[coord.x, coord.y, coord.z] = type;

        var mesh = ChunkFactory.Build(Blocks);

        Mesh            = mesh;
        meshFilter.mesh = mesh;
    }