示例#1
0
 public static bool Unregister(string key)
 {
     if (key == null)
     {
         throw new ArgumentNullException(key);
     }
     return(TimerBase <T> .GetInstance()?.UnregisterInternal(key));
 }
示例#2
0
        public static void Unregister()
        {
            T instance = TimerBase <T> .GetInstance();

            if (instance != null)
            {
                instance.OnRemove();
            }
        }
示例#3
0
        public static void Register(string key, float timeout, Action <float> onTimer)
        {
            if (key == null)
            {
                throw new ArgumentNullException(key);
            }
            T instance = TimerBase <T> .GetInstance();

            if (instance != null)
            {
                instance.RegisterInternal(key, timeout, timeout, onTimer, null, null, 1);
            }
        }
示例#4
0
        public static void Register(string key, float delay, float interval, Action <float> onTimer, Action onCanceled, int times)
        {
            if (key == null)
            {
                throw new ArgumentNullException(key);
            }
            T instance = TimerBase <T> .GetInstance();

            if (instance != null)
            {
                instance.RegisterInternal(key, delay, interval, onTimer, null, onCanceled, times);
            }
        }
示例#5
0
 public static ulong Register(float delay, float interval, Action <float> onTimer) =>
 TimerBase <T> .GetInstance()?.RegisterInternal(null, delay, interval, onTimer, null, null, 1);
示例#6
0
 public static ulong Register(float timeout, Action <float> onTimer, int times) =>
 TimerBase <T> .GetInstance()?.RegisterInternal(null, timeout, timeout, onTimer, null, null, times);
示例#7
0
 public static ulong Register(float timeout, Action onTimer, Action onCanceled) =>
 TimerBase <T> .GetInstance()?.RegisterInternal(null, timeout, timeout, null, onTimer, onCanceled, 1);
示例#8
0
 public static bool Unregister(ulong id) =>
 TimerBase <T> .GetInstance()?.UnregisterInternal((long)id);
示例#9
0
 public static ulong Register(float delay, float interval, Action onTimer, Action onCanceled, int times) =>
 TimerBase <T> .GetInstance()?.RegisterInternal(null, delay, interval, null, onTimer, onCanceled, times);