Optimize GC for mesh wrapper.

This commit is contained in:
2023-03-24 17:10:30 +08:00
parent e2c683567e
commit e03dbef5ff
3 changed files with 7 additions and 4 deletions

View File

@@ -89,7 +89,7 @@ namespace Cryville.Crtr.Components {
protected void InternalInit(string meshName = "quad") {
mesh.Init(transform);
mesh.Renderer.sharedMaterials = materials = new Material[] { MeshWrapper.NewMaterial() };
mesh.Mesh = GenericResources.Meshes[meshName];
mesh.Mesh = Mesh.Instantiate(GenericResources.Meshes[meshName]);
UpdateColor();
UpdateScale();
UpdateZIndex();