using UnityEngine;
using System;

namespace mgaia.Utils
{
    public class ReusableWrapper : MonoBehaviour
    {
        public Action OnDestroyForwarder
        {
            get;
            set;
        }

        private void OnDestroy()
        {
            if (OnDestroyForwarder == null)
            {
                throw new InvalidOperationException("OnDestroyForwarder must be non-null");
            }
            OnDestroyForwarder();
        }
    }
}