Files
VR-WuKong/Assets/ThirdParty/Tools/MeshCombineStudio/Scripts/Misc/GarbageCollectMesh.cs

26 lines
540 B
C#
Raw Normal View History

2025-11-14 18:44:06 +08:00
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
namespace MeshCombineStudio
{
[ExecuteInEditMode]
public class GarbageCollectMesh : MonoBehaviour
{
public Mesh mesh;
void OnDestroy()
{
if (mesh != null)
{
#if UNITY_EDITOR
DestroyImmediate(mesh);
#else
Destroy(mesh);
#endif
}
// Debug.Log("Destroy Mesh");
}
}
}