using System;
using UnityEngine;

namespace Assets.Source.Misc
{
    public abstract class MonoDestroyTracker : MonoBehaviour, IReleaseTracker
    {
        public event Action OnRelease;

        void OnDestroy()
        {
            OnRelease?.Invoke();
            VOnDestroy();
        }

        protected virtual void VOnDestroy() { }
    }
}
