예제 #1
0
        public void OnDisable()
        {
            ResourceCleaner componentInParent = GetComponentInParent <ResourceCleaner>();

            if (componentInParent != null && componentInParent.CleanOnDisable)
            {
                this.DestroyResources();
            }
        }
예제 #2
0
        public void OnDestroy()
        {
            ResourceCleaner componentInParent = GetComponentInParent <ResourceCleaner>();

            if (componentInParent == null)
            {
                this.DestroyResources();
            }
            if (OnDestroyCallback != null)
            {
                OnDestroyCallback(base.gameObject);
            }
        }