using UnityEngine;
|
using Cysharp.Threading.Tasks;
|
using System;
|
|
public static class UniTaskExtension
|
{
|
public static void DelayFrame(this GameObject go, Action action)
|
{
|
DelayFrameInternal(action);
|
}
|
|
public static void DelayFrame(this Component cmp, Action action)
|
{
|
DelayFrameInternal(action);
|
}
|
|
private async static UniTask DelayFrameInternal(Action action)
|
{
|
await UniTask.DelayFrame(1);
|
action?.Invoke();
|
}
|
}
|