hch
2025-11-21 eb27e5fd31f73b998a4bbd85511a31e40b8c61b7
Main/Utility/GlobalTimeEvent.cs
@@ -5,8 +5,8 @@
public class GlobalTimeEvent : SingletonMonobehaviour<GlobalTimeEvent>
{
    public event Action MSEvent; // 每50ms
    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.05f)
        {
            if (MSEvent != null)
            {
                MSEvent();
            }
            msBuf = ms;
        }
        var second = DateTime.Now.Second;
        if (second != secondBuf)
        {