| | |
| | | public event Action<string> RefresCoolTimeAct;
|
| | | public event Action<string> RefreshItemOverdueTimeAct;
|
| | | public event Action<string> RefreshItemOverdueAct;
|
| | | public event Action<int,int> RefreshNormalCDAct;
|
| | | int secondBuf = -1;
|
| | | int minuteBuf = -1;
|
| | | private void LateUpdate()
|
| | |
| | | {
|
| | | RefresCoolTimeAct(itemCDList[i].guid);
|
| | | }
|
| | | |
| | | break;
|
| | | case TimeRefreshType.Minute:
|
| | | if(RefreshItemOverdueTimeAct != null)
|
| | |
| | | case TimeRefreshType.Frame:
|
| | | break;
|
| | | case TimeRefreshType.Second:
|
| | | if(normalCDList[i].func != null)
|
| | | if(RefreshNormalCDAct != null)
|
| | | {
|
| | | normalCDList[i].func(normalCDList[i].code,(int)remianCD);
|
| | | RefreshNormalCDAct(normalCDList[i].code,(int)remianCD);
|
| | | }
|
| | | break;
|
| | | case TimeRefreshType.Minute:
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | public void Register(int code,double cdTime,Action<int,int> func)
|
| | | public void Register(int code,double cdTime)
|
| | | {
|
| | | int index;
|
| | | if (ContainsNormalCD(code, out index))
|
| | |
| | | }
|
| | | else
|
| | | {
|
| | | NormalCDCool cool = new NormalCDCool(code,cdTime,func);
|
| | | NormalCDCool cool = new NormalCDCool(code,cdTime);
|
| | | normalCDList.Add(cool);
|
| | | }
|
| | | }
|
| | |
| | | public int code;
|
| | | public double totalTime;
|
| | | public DateTime startTime { get; private set; }
|
| | | public Action<int,int> func;
|
| | | public NormalCDCool(int code,double totalTime,Action<int,int> func)
|
| | | public NormalCDCool(int code,double totalTime)
|
| | | {
|
| | | this.code = code;
|
| | | this.totalTime = totalTime;
|
| | | this.startTime = DateTime.Now;
|
| | | this.func = func;
|
| | | }
|
| | |
|
| | | public void SetTime(double totalTime)
|