public Skill(int id) { if (CfgManager.GetInstance().Skills.ContainsKey(id) == false) { Debug.LogErrorFormat("skill cfg not found: {0}", id); return; } CfgSkill cfg = CfgManager.GetInstance().Skills[id]; this.id = cfg.id; name = cfg.name; desc = cfg.desc; animation = cfg.animation; sound = cfg.sound; hiteffect = cfg.hiteffect; hitpoints = cfg.hitpoints; targettype = cfg.targettype; aoe = cfg.aoe; spcost = cfg.spcost; colddown = cfg.colddown; // skill effects int count = cfg.skilleffects.Length; if (count > 0) { skilleffects = new SkillEffect[count]; for (int i = 0; i < count; i++) { skilleffects[i] = SkillEffect.CreateSkillEffect(cfg.skilleffects[i], this); } } }
private int hitcount = 0; // 统计攻击次数 public void SetInfo(int id, Character actor, SkillSummonInfo info) { ID = id; owner = actor; cfg = CfgManager.GetInstance().SkillSummons[info.id]; skill = actor.GetSkill(info.skillid); // skill effects int count = cfg.skilleffects.Length; if (count > 0) { skilleffects = new SkillEffect[count]; for (int i = 0; i < count; i++) { skilleffects[i] = SkillEffect.CreateSkillEffect(cfg.skilleffects[i], skill); } } }