using System; using UnityEngine; namespace UnityEngine.Purchasing { /// /// Lifecycle notifier waits to be destroyed before calling a callback. /// Use to notify script of hierarchy destruction for avoiding dynamic /// UI hierarchy collisions. /// internal class LifecycleNotifier : MonoBehaviour { public Action OnDestroyCallback; void OnDestroy() { OnDestroyCallback?.Invoke(); } } }