22 lines
458 B
C#
22 lines
458 B
C#
|
|
using System;
|
||
|
|
using System.Collections;
|
||
|
|
using UnityEngine;
|
||
|
|
|
||
|
|
public class CoroutineMgr : MonoBehaviourSingletonTemplate<CoroutineMgr>
|
||
|
|
{
|
||
|
|
private void Start()
|
||
|
|
{
|
||
|
|
DontDestroy();
|
||
|
|
}
|
||
|
|
|
||
|
|
public void Set_Coroutine(Action _act, float _time)
|
||
|
|
{
|
||
|
|
StartCoroutine(Run_Coroutine(_act, _time));
|
||
|
|
}
|
||
|
|
|
||
|
|
IEnumerator Run_Coroutine(Action _act, float _time)
|
||
|
|
{
|
||
|
|
yield return new WaitForSeconds(_time);
|
||
|
|
_act?.Invoke();
|
||
|
|
}
|
||
|
|
}
|