예제 #1
0
파일: CTimer.cs 프로젝트: yuka800/lop-lib
        public static int SetTimeout(CSLib.Utility.Action <object> closure, float delay, object data = null, int repeatCount = 1)
        {
            CTimeTicker timeTicker = new CTimeTicker(delay, repeatCount, data);

            timeTicker.CompleteFuncData  = closure;
            timeTicker.ATickCompleteFunc = SetTimeoutComplete;
            timeTicker.Start();
            int num = timeTicker.id = ++sTickerID;

            sTickerMap[num] = timeTicker;
            return(num);
        }
예제 #2
0
파일: CTimer.cs 프로젝트: yuka800/lop-lib
 public static int SetInterval(CSLib.Utility.Action <object> UpdateFunc, float delay, object data = null)
 {
     if (funcList.IndexOf(UpdateFunc) == -1)
     {
         funcList.Add(UpdateFunc);
         CTimeTicker timeTicker = new CTimeTicker(delay, 0, data);
         timeTicker.TimerFuncData = UpdateFunc;
         timeTicker.Start();
         int num = timeTicker.id = ++sTickerID;
         sTickerMap[num] = timeTicker;
         return(num);
     }
     throw new Exception("this function couldn't be setInterval twice!");
 }