Beispiel #1
0
        public void LateUpdate(float deltaTime)
        {
            if (!_isDirty)
            {
                return;
            }

            _isDirty = false;
            _blockMeshBuilder.BuildMesh(_mesh, _levelModel.IterateBlocks());
        }
        public Mesh GetShapeMesh(BlockShapeData shapeData)
        {
            if (!_shapes.TryGetValue(shapeData.ShapeType, out var mesh))
            {
                var textureId = _shapeTextureProvider.GetTexture(shapeData);
                mesh = _meshBuilder.BuildMesh(shapeData.Sections, textureId);
                _shapes[shapeData.ShapeType] = mesh;
            }

            return(mesh);
        }