public class Block : IRenderData {
public static Block Standard {
get { return new Block(); }
}
public Vector3 Position { get; set; } = Vector3.zero;
[SaveThis(SaveAs = "rotation")]
public Vector3 Rotation { get; set; } = Vector3.zero;
[SaveThis(SaveAs = "scale")]
public Vector3 Scale { get; set; } = Vector3.one;
public GpuColor Color {
get { return this.RawColor.ToGpuColor(); }
}
[SaveThis(SaveAs = "color")]
public Color24 RawColor { get; set; } = Colors.DefaultBlockColor;
[SaveThis(SaveAs = "material")]
public MaterialType Material { get; set; }
[SaveThis(SaveAs = "colliderData")]
public ColliderData ColliderData { get; set; } = ColliderData.Standard;
[DontSaveThis]
public Mesh Mesh {
get {
if (this._Mesh == null) {
this._Mesh = Meshes.FromString(this.MeshName);
}
return this._Mesh;
} set {
this._Mesh = value;
}
}
[SaveThis(SaveAs = "mesh")]
public string MeshName = "BetterCube";
private Mesh _Mesh;
}