/// <summary> /// 净化buff /// </summary> public void JingHua() { foreach (eBuffType buffType in keys) { BuffBase bb = list_buff[buffType]; if (bb.blDebuff) { bb.onExit(); list_buff.Remove(bb.buffType); } } }
public void Update() { if (Time.timeScale > 0) { blDelete = false; //处理buff if (list_buff != null && list_buff.Count > 0) { if (keys == null) { keys = new eBuffType[list_buff.Count]; list_buff.Keys.CopyTo(keys, 0); } foreach (eBuffType buffType in keys) { BuffBase bb = list_buff[buffType]; bb.onUpdate(); bb.durationTime -= Time.deltaTime; if (bb.durationTime <= 0) { blDelete = true; list_buff.Remove(bb.buffType); bb.onExit(); } } if (blDelete) { if (list_buff.Count > 0) { keys = new eBuffType[list_buff.Count]; list_buff.Keys.CopyTo(keys, 0); } else { keys = null; } } } //技能处理 if (list_skill != null && list_skill.Count > 0) { //new CoolDown(x.Value.recharge_skill_timer + Time.deltaTime, GameData.skills[x.Key]) list_skill = list_skill.ToDictionary(x => x.Key, x => GetCoolDown(x.Value, Time.deltaTime)); } } }