少年修仙传客户端代码仓库
Client_PangDeRong
2018-10-16 2ea461c8ee7cb0b85cad8a79319c7b1ce9399fc3
System/KnapSack/KnapsackTimeCDMgr.cs
@@ -13,6 +13,7 @@
        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()
@@ -45,7 +46,6 @@
                        {
                            RefresCoolTimeAct(itemCDList[i].guid);
                        }
                        break;
                    case TimeRefreshType.Minute:
                        if(RefreshItemOverdueTimeAct != null)
@@ -78,9 +78,9 @@
                    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:
@@ -109,7 +109,7 @@
            }
        }
        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))
@@ -118,7 +118,7 @@
            }
            else
            {
                NormalCDCool cool = new NormalCDCool(code,cdTime,func);
                NormalCDCool cool = new NormalCDCool(code,cdTime);
                normalCDList.Add(cool);
            }
        }
@@ -252,13 +252,11 @@
        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)