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); }
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; }
public void BuildMesh() { Mesh = BlockMesh.Create(this); }