コード例 #1
0
        public static BlockMesh Create(Block block)
        {
            var mesh = new BlockMesh();

            for (int i = 0; i < Side.Count; i++)
            {
                var prototype = block.MeshPrototype.MeshParts[i];
                if (prototype == null)
                {
                    continue;
                }

                var texCoordOffset = Vector2.Zero;

                var tile = block.Tiles[i];
                if (tile != null)
                {
                    tile.GetTexCoordOffset(out texCoordOffset);
                }

                mesh.MeshParts[i] = Create(prototype, ref texCoordOffset);
            }

            return(mesh);
        }
コード例 #2
0
ファイル: BlockMesh.cs プロジェクト: willcraftia/TestBlocks
        public static BlockMesh Create(Block block)
        {
            var mesh = new BlockMesh();

            for (int i = 0; i < Side.Count; i++)
            {
                var prototype = block.MeshPrototype.MeshParts[i];
                if (prototype == null) continue;

                var texCoordOffset = Vector2.Zero;

                var tile = block.Tiles[i];
                if (tile != null) tile.GetTexCoordOffset(out texCoordOffset);

                mesh.MeshParts[i] = Create(prototype, ref texCoordOffset);
            }

            return mesh;
        }
コード例 #3
0
 public void BuildMesh()
 {
     Mesh = BlockMesh.Create(this);
 }