Remove transparent property.

This commit is contained in:
2022-11-18 10:23:51 +08:00
parent bf942cbe45
commit 1be5cc77ca
5 changed files with 6 additions and 20 deletions

View File

@@ -105,7 +105,7 @@ namespace Cryville.Crtr.Components {
body.Load();
tail.Load();
mesh.Init(transform, transparent);
mesh.Init(transform);
List<Material> materials = new List<Material>();
if (head.FrameName != null) AddMat(materials, head.FrameName);

View File

@@ -5,7 +5,6 @@ namespace Cryville.Crtr.Components {
public abstract class SpriteBase : MeshBase {
public SpriteBase() {
SubmitProperty("bound", new op_set_bound(this));
SubmitProperty("transparent", new PropOp.Boolean(v => transparent = v));
SubmitProperty("pivot", new PropOp.Vector2(v => Pivot = v));
SubmitProperty("scale", new PropOp.Vector2(v => Scale = v));
SubmitProperty("ui", new PropOp.Boolean(v => UI = v));
@@ -91,10 +90,8 @@ namespace Cryville.Crtr.Components {
}
}
public bool transparent = false;
protected void InternalInit(string meshName = "quad") {
mesh.Init(transform, transparent);
mesh.Init(transform);
mesh.Mesh = GenericResources.Meshes[meshName];
UpdateScale();
UpdateZIndex();

View File

@@ -4,8 +4,6 @@ namespace Cryville.Crtr.Components {
public class SpriteRect : SpriteBase {
public SpriteRect() {
SubmitProperty("color", new PropOp.Color(v => Color = v));
transparent = true;
}
Color _color;

View File

@@ -86,7 +86,7 @@ namespace Cryville.Crtr.Components {
else if (frameHeight != f.Value.Rect.height) throw new Exception("Inconsistent frame height");
if (!meshes.ContainsKey(f.Value.Frame.Texture)) {
var m = new MeshWrapper();
m.Init(mesh.MeshTransform, transparent);
m.Init(mesh.MeshTransform);
m.Mesh = new Mesh();
m.Renderer.material.mainTexture = f.Value.Frame.Texture;
meshes.Add(f.Value.Frame.Texture, m);