yyl
15 小时以前 30ba2ef747ced774bef177d5273cb5a3429cff49
Main/Utility/UniTaskExtension.cs
@@ -6,17 +6,27 @@
{
   public static void DelayFrame(this GameObject go, Action action)
    {
        DelayFrameInternal(action);
        DelayFrameInternal(1, action);
    }
   public static void DelayFrame(this Component cmp, Action action)
    {
        DelayFrameInternal(action);
        DelayFrameInternal(1, action);
    }
    private async static UniTask DelayFrameInternal(Action action)
    private async static UniTask DelayFrameInternal(int frame, Action action)
    {
        await UniTask.DelayFrame(1);
        await UniTask.DelayFrame(frame);
        action?.Invoke();
    }
    public static void DelayFrames(this Component cmp, int frames, Action action)
    {
        DelayFrameInternal(frames, action);
    }
    public static void DelayFrames(this GameObject go, int frames, Action action)
    {
        DelayFrameInternal(frames, action);
    }
}