Change materials to shared mode in components.
This commit is contained in:
@@ -46,11 +46,15 @@ namespace Cryville.Crtr.Components {
|
||||
}
|
||||
|
||||
protected override void OnDestroy() {
|
||||
if (materials != null)
|
||||
foreach (var mat in materials) {
|
||||
Material.Destroy(mat);
|
||||
}
|
||||
DestroyMaterials();
|
||||
mesh.Destroy();
|
||||
}
|
||||
|
||||
protected void DestroyMaterials() {
|
||||
if (materials == null) return;
|
||||
foreach (var mat in materials) {
|
||||
Material.Destroy(mat);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user