From c6ccb0a41bf595fb069ffb2ab75928dbdf23ac2e Mon Sep 17 00:00:00 2001
From: yyl <yyl>
Date: 星期三, 05 十一月 2025 11:53:52 +0800
Subject: [PATCH] Merge branch 'master' of http://192.168.1.20:10010/r/Project_SG_scripts

---
 Main/Utility/GlobalTimeEvent.cs |   14 +++++++++++++-
 1 files changed, 13 insertions(+), 1 deletions(-)

diff --git a/Main/Utility/GlobalTimeEvent.cs b/Main/Utility/GlobalTimeEvent.cs
index 66d9296..9da381a 100644
--- a/Main/Utility/GlobalTimeEvent.cs
+++ b/Main/Utility/GlobalTimeEvent.cs
@@ -5,8 +5,8 @@
 
 
 public class GlobalTimeEvent : SingletonMonobehaviour<GlobalTimeEvent>
-
 {
+    public event Action MS100Event;
     public event Action secondEvent;
     public event Action fiveSecondEvent;
     public event Action minuteEvent;
@@ -16,6 +16,7 @@
     public event Action hourEvent;
     public event Action halfMinuteEvent;
 
+    float msBuf = 0f;
     int secondBuf = -1;
     int fiveSecondBuf = -1;
     int minuteBuf = -1;
@@ -32,6 +33,17 @@
 
     private void Update()
     {
+        var ms = Time.time;
+        if (ms - msBuf >= 0.1f)
+        {
+            if (MS100Event != null)
+            {
+                MS100Event();
+            }
+            msBuf = ms;
+        }
+
+
         var second = DateTime.Now.Second;
         if (second != secondBuf)
         {

--
Gitblit v1.8.0