Add backward compatibility for opacity property.

This commit is contained in:
2023-02-19 22:44:12 +08:00
parent 3bf3fdac3d
commit 6c983cc2cb

View File

@@ -5,6 +5,11 @@ namespace Cryville.Crtr.Components {
public abstract class MeshBase : SkinComponent {
public MeshBase() {
SubmitProperty("color", new PropOp.Color(v => Color = v));
SubmitProperty("opacity", new PropOp.Float(v => {
var c = Color;
c.a *= v;
Color = c;
}));
SubmitProperty("zindex", new PropOp.Integer(v => ZIndex = (short)v));
}