| | |
| | | |
| | | |
| | | public class GlobalTimeEvent : SingletonMonobehaviour<GlobalTimeEvent> |
| | | |
| | | { |
| | | public event Action MS100Event; |
| | | public event Action secondEvent; |
| | | public event Action fiveSecondEvent; |
| | | public event Action minuteEvent; |
| | |
| | | public event Action hourEvent; |
| | | public event Action halfMinuteEvent; |
| | | |
| | | float msBuf = 0f; |
| | | int secondBuf = -1; |
| | | int fiveSecondBuf = -1; |
| | | int minuteBuf = -1; |
| | |
| | | |
| | | 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) |
| | | { |