29 lines
636 B
C#
29 lines
636 B
C#
using System;
|
|
|
|
namespace Cryville.Crtr.Components {
|
|
public abstract class MeshBase : SkinComponent {
|
|
public MeshBase() {
|
|
SubmitProperty("zindex", new PropOp.Integer(v => ZIndex = (short)v));
|
|
}
|
|
|
|
protected MeshWrapper mesh = new MeshWrapper();
|
|
|
|
short _zindex;
|
|
public short ZIndex {
|
|
get {
|
|
return _zindex;
|
|
}
|
|
set {
|
|
if (value < 0 || value > 5000)
|
|
throw new ArgumentOutOfRangeException("value", "Z-index must be in [0..5000]");
|
|
_zindex = value;
|
|
UpdateZIndex();
|
|
}
|
|
}
|
|
protected void UpdateZIndex() {
|
|
if (!mesh.Initialized) return;
|
|
mesh.Renderer.material.renderQueue = _zindex;
|
|
}
|
|
}
|
|
}
|