Exemple #1
0
        public void FinalizeBake()
        {
            _opaqueCollidedMesh.ClearMesh();
            _translucentPassableMesh.ClearMesh();
            _opaquePassableMesh.ClearMesh();
            _opaqueCollidedMesh.BakeMesh();
            _translucentPassableMesh.BakeMesh();
            _opaquePassableMesh.BakeMesh();

            Ready = false;
        }
        public void DrawBlock(BlockData data)
        {
            _genMesh.ClearAll();
            var desc = StaticResources.BlocksInfo.GetBlockDescription(data.Type);
            var inp  = new MesherBlockInput()
            {
                Block = data, Lighting = LightInfo.FullLit, Position = Byte3.Zero, Visibility = VisibilityFlags.All
            };

            BlockModelGenerator.AddBlock(_genMesh, desc, ref Offset, ref inp);
            _renderer.material = VoxelsStatic.Instance.OpaqueMaterial;
            _genMesh.BakeMesh();
            _filter.mesh = _genMesh.Mesh;
        }