add new corutine utils
This commit is contained in:
parent
b6bb6f639d
commit
47b8c1cc50
@ -16,6 +16,17 @@ namespace NEG.Utils
|
||||
}
|
||||
}
|
||||
|
||||
public static void ActionAfterFrames(this MonoBehaviour mono, int count, Action action)
|
||||
{
|
||||
mono.StartCoroutine(ActionAfterFrames(count, action));
|
||||
}
|
||||
|
||||
public static IEnumerator ActionAfterFrames(int count, Action action)
|
||||
{
|
||||
yield return WaitForFrames(count);
|
||||
action?.Invoke();
|
||||
}
|
||||
|
||||
public static IEnumerator ActionAfterEndOfFrame(Action action)
|
||||
{
|
||||
yield return WaitForEndOfFrame;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user