Pull up mesh.color. Remove *.opacity properties.

This commit is contained in:
2023-02-19 22:06:20 +08:00
parent a115999aab
commit ba3238614b
6 changed files with 20 additions and 53 deletions

View File

@@ -11,7 +11,6 @@ namespace Cryville.Crtr.Components {
SubmitProperty("value", new PropOp.TargetString(() => Value));
SubmitProperty("size", new PropOp.Float(v => Size = v));
SubmitProperty("spacing", new PropOp.Float(v => Spacing = v));
SubmitProperty("opacity", new PropOp.Float(v => Opacity = v));
}
#pragma warning disable IDE1006
@@ -94,6 +93,7 @@ namespace Cryville.Crtr.Components {
tris.Add(tex, new List<int>());
}
}
UpdateColor();
}
float sum_x;
@@ -158,23 +158,6 @@ namespace Cryville.Crtr.Components {
get { return new Vector2(-0.5f, -0.5f); }
}
float _opacity = 1;
public float Opacity {
get { return _opacity; }
set {
_opacity = value;
UpdateOpacity();
}
}
void UpdateOpacity() {
if (!mesh.Initialized) return;
foreach (var m in meshes) {
var c = m.Value.Renderer.material.color;
c.a = _opacity;
m.Value.Renderer.material.color = c;
}
}
public override void Init() {
InternalInit();
UpdateFrames();