void OnDestroy() { meshRenderer.sharedMaterial = null; meshFilter.sharedMesh = null; UnityEngine.MeshRenderer.Destroy(meshRenderer); MeshFilter.Destroy(meshFilter); Mesh.Destroy(mesh); }
public override void Destruct() { meshRenderer.sharedMaterial = null; ResourceCache.SharedInstance().UnloadTexture(data.name, textureName); meshFilter.sharedMesh = null; UnityEngine.MeshRenderer.Destroy(meshRenderer); MeshFilter.Destroy(meshFilter); Mesh.Destroy(mesh); base.Destruct(); }