From fbc7f855aa676d2a623bec2cfb07e19d91b6bc26 Mon Sep 17 00:00:00 2001
From: lcy <1459594991@qq.com>
Date: 星期二, 20 一月 2026 16:49:23 +0800
Subject: [PATCH] 411 定军阁-客户端 开出展示npc配置,隐藏敌将信息按钮,隐藏定军阁战场血条相关信息

---
 Main/Utility/UniTaskExtension.cs |   30 ++++++++++++++++++++++++++++--
 1 files changed, 28 insertions(+), 2 deletions(-)

diff --git a/Main/Utility/UniTaskExtension.cs b/Main/Utility/UniTaskExtension.cs
index 58ff6bd..2ff6255 100644
--- a/Main/Utility/UniTaskExtension.cs
+++ b/Main/Utility/UniTaskExtension.cs
@@ -4,12 +4,12 @@
 
 public static class UniTaskExtension
 {
-	public static void DelayFrame(this GameObject go, Action action)
+    public static void DelayFrame(this GameObject go, Action action)
     {
         DelayFrameInternal(1, action);
     }
 
-	public static void DelayFrame(this Component cmp, Action action)
+    public static void DelayFrame(this Component cmp, Action action)
     {
         DelayFrameInternal(1, action);
     }
@@ -29,4 +29,30 @@
     {
         DelayFrameInternal(frames, action);
     }
+
+    public static void DelayFrame(Action action)
+    {
+        DelayFrameInternal(1, action);
+    }
+
+    public static void DelayTime(this GameObject go, float time, Action action)
+    {
+        DelayTimeInternal(time, action);
+    }
+
+    public static void DelayTime(this Component cmp, float time, Action action)
+    {
+        DelayTimeInternal(time, action);
+    }
+
+    private async static UniTask DelayTimeInternal(float time, Action action)
+    {
+        if (time <= 0f)
+        {
+            action?.Invoke();
+            return;
+        }
+        await UniTask.Delay(TimeSpan.FromSeconds(time));
+        action?.Invoke();
+    }
 }
\ No newline at end of file

--
Gitblit v1.8.0