using System.Collections.Generic; using UnityEngine; namespace UniGLTF { /// /// Mesh, Material, Texture などを抱えておいて確実に破棄できるようにする /// public class UnityResourceDestroyer : MonoBehaviour { List m_resources = new List(); public IList Resources => m_resources; void OnDestroy() { Debug.Log("UnityResourceDestroyer.OnDestroy"); foreach (var x in Resources) { #if VRM_DEVELOP Debug.Log($"Destroy: {x}"); #endif Destroy(x); } } } }