From 9f5db2e92b93dcbe7c5d53606d62c8f04aef3c19 Mon Sep 17 00:00:00 2001
From: lcy <1459594991@qq.com>
Date: 星期三, 18 三月 2026 23:20:18 +0800
Subject: [PATCH] 533 开服冲榜-客户端 开服冲榜的将星云集、百炼成军、红袖添香、命定乾坤和限时冲刺的武将冲刺、古宝冲刺、元宝冲刺添加特权标识
---
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