} // end CharacterBuff public void Update() { if (buffList.Count == 0) return; // end if signList.Clear(); for (int i = 0; i < buffList.Count; i++) { int index = i; if (buffList[index].IsOverTime(UnityEngine.Time.deltaTime)) signList.Add(index); // end if } // end for if (signList.Count == 0) return; // end if for (int i = 0; i < signList.Count; i++) { buffList.RemoveAt(signList[i]); } // end for if (null == center) return; // end if center.Broadcast(CenterEvent.BuffChange); } // end Update
} // end EnoughWithIDAndCount public void UseItemWithGid(int gid) { if (gid < 0 || gid >= idList.Length) { return; } // end if string itemID = idList[gid]; IEquipInfo info = Configs.itemConfig.GetItemInfo(itemID) as IEquipInfo; if (null == info || (info.role != ConstConfig.ALLROLE && info.role != roleType)) { return; // 检测是否是装备,是否符合当前角色类型 } // end if string type = info.type; if (!wearDict.ContainsKey(type)) { return; // 检测装备类型是否存在 } // end if if (null == wearDict[type]) { idList[gid] = "0"; } else { idList[gid] = wearDict[type].id; } // end if wearDict[type] = info; WriteGridInfo(gid, idList[gid], 0); SqliteManager.SetWearInfoWithID(username, roleindex, type, info.id); if (null == center) { return; } // end if center.Broadcast(Character.CenterEvent.ReloadEquip); } // end UseItemWithGid