lib_unity_purchase/Runtime/Stores/FakeStore/LifecycleNotifier.cs

21 lines
485 B
C#

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