SDK_UnityMoney/Assets/Script/Utils/TimerUtils.cs

24 lines
528 B
C#
Raw Normal View History

2025-08-30 09:24:58 +00:00
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
2025-09-01 10:32:50 +00:00
namespace WZ
2025-08-31 02:12:10 +00:00
{
2025-09-01 13:28:17 +00:00
public class TimerUtils :D_MonoSingleton<TimerUtils>
2025-08-30 09:24:58 +00:00
{
2025-09-01 13:28:17 +00:00
public void DelayExecute(float delay, System.Action action)
2025-08-31 02:12:10 +00:00
{
2025-09-01 13:28:17 +00:00
StartCoroutine(DelayExecuteCoroutine(delay, action));
2025-08-31 02:12:10 +00:00
}
2025-09-01 13:28:17 +00:00
private IEnumerator DelayExecuteCoroutine(float delay, System.Action action)
2025-08-30 09:24:58 +00:00
{
yield return new WaitForSeconds(delay);
action?.Invoke();
}
}
}