Pull up mesh.color
. Remove *.opacity
properties.
This commit is contained in:
@@ -4,6 +4,7 @@ using UnityEngine;
|
||||
namespace Cryville.Crtr.Components {
|
||||
public abstract class MeshBase : SkinComponent {
|
||||
public MeshBase() {
|
||||
SubmitProperty("color", new PropOp.Color(v => Color = v));
|
||||
SubmitProperty("zindex", new PropOp.Integer(v => ZIndex = (short)v));
|
||||
}
|
||||
|
||||
@@ -28,6 +29,22 @@ namespace Cryville.Crtr.Components {
|
||||
mat.renderQueue = _zindex;
|
||||
}
|
||||
}
|
||||
|
||||
Color _color = Color.white;
|
||||
public Color Color {
|
||||
get { return _color; }
|
||||
set {
|
||||
_color = value;
|
||||
UpdateColor();
|
||||
}
|
||||
}
|
||||
protected void UpdateColor() {
|
||||
if (!mesh.Initialized) return;
|
||||
foreach (var mat in materials) {
|
||||
mat.color = _color;
|
||||
}
|
||||
}
|
||||
|
||||
protected override void OnDestroy() {
|
||||
if (materials != null)
|
||||
foreach (var mat in materials) {
|
||||
|
Reference in New Issue
Block a user