lib_unity_purchase/Runtime/Stores/FakeStore/LifecycleNotifier.cs

21 lines
485 B
C#
Raw Normal View History

2025-01-20 12:55:54 +08:00
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();
}
}
}