少年修仙传客户端代码仓库
client_Wu Xijin
2018-10-15 bd19eadbee8a0d3ec67c36a166a8cca4f87f454e
Utility/GlobalTimeEvent.cs
@@ -11,6 +11,7 @@
    public event Action tenMinuteEvent;
    public event Action halfHourEvent;
    public event Action hourEvent;
    public event Action halfMinuteEvent;
    int secondBuf = -1;
    int minuteBuf = -1;
@@ -18,6 +19,7 @@
    int tenMinuteBuf = -1;
    int halfHourBuf = -1;
    int hourBuf = -1;
    int halfMinuteBuf = -1;
    public void Begin()
    {
@@ -57,6 +59,26 @@
            }
        }
        var thirtySeconds = second / 30;
        if (halfMinuteBuf != thirtySeconds)
        {
            try
            {
                if (halfMinuteEvent != null)
                {
                    halfMinuteEvent();
                }
            }
            catch (Exception ex)
            {
                Debug.LogException(ex);
            }
            finally
            {
                halfMinuteBuf = thirtySeconds;
            }
        }
        var fiveMinute = minute / 5;
        if (fiveMinuteBuf != fiveMinute)
        {