Пример #1
0
        public void StartCD(int nSkillID, float fCDtime)
        {
            if (Owner == null)
            {
                return;
            }

            DRCDdefine pCDData = GameEntry.DataTable.GetDataTable <DRCDdefine>().GetDataRow(nSkillID);

            if (pCDData != null)
            {
                StartCD(nSkillID);
                return;
            }

            sCDInfo info = new sCDInfo();

            info.fCurTime   = fCDtime;
            info.fTotalTime = fCDtime;

            if (m_CDDict.ContainsKey(nSkillID))
            {
                float fTime = m_CDDict[nSkillID].fCurTime;
                fTime = Mathf.Max(fTime, info.fCurTime);
                m_CDDict[nSkillID].UpdateCD(fTime);
            }
            else
            {
                AddCDToDict(nSkillID, info);
            }
        }
Пример #2
0
        private void AddCDToDict(int nCDindex, float fCDtime)
        {
            sCDInfo info = new sCDInfo();

            info.fCurTime   = fCDtime;
            info.fTotalTime = fCDtime;
            m_CDDict.Add(nCDindex, info);
        }
Пример #3
0
        public void StartCommonCD(int nCommonCD)
        {
            if (Owner == null)
            {
                return;
            }
            DRCDdefine pCommonCDData = GameEntry.DataTable.GetDataTable <DRCDdefine>().GetDataRow(nCommonCD);

            if (pCommonCDData == null)
            {
                return;
            }

            sCDInfo info = new sCDInfo();

            info.fCurTime   = pCommonCDData.CDTime;
            info.fTotalTime = pCommonCDData.CDTime;
            m_CDCommonDict[pCommonCDData.Id] = info;
        }
Пример #4
0
 private void AddCDToDict(int nCDindex, sCDInfo info)
 {
     m_CDDict.Add(nCDindex, info);
 }