Exemplo n.º 1
0
        public void OnDisable()
        {
            ResourceCleaner componentInParent = GetComponentInParent <ResourceCleaner>();

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

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