24 lines
528 B
C#
24 lines
528 B
C#
using System;
|
|
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
|
|
namespace WZ
|
|
{
|
|
public class TimerUtils :D_MonoSingleton<TimerUtils>
|
|
{
|
|
public void DelayExecute(float delay, System.Action action)
|
|
{
|
|
StartCoroutine(DelayExecuteCoroutine(delay, action));
|
|
}
|
|
|
|
private IEnumerator DelayExecuteCoroutine(float delay, System.Action action)
|
|
{
|
|
yield return new WaitForSeconds(delay);
|
|
action?.Invoke();
|
|
}
|
|
}
|
|
|
|
}
|
|
|