111
This commit is contained in:
25
Assets/ThirdParty/Tools/MeshCombineStudio/Scripts/Misc/GarbageCollectMesh.cs
vendored
Normal file
25
Assets/ThirdParty/Tools/MeshCombineStudio/Scripts/Misc/GarbageCollectMesh.cs
vendored
Normal file
@@ -0,0 +1,25 @@
|
||||
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");
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user