SkillManager() { SkillcdList.Clear(); skillObj sk1 = new skillObj(0, "放炸弹", "在原地放一个炸弹,不会伤害到玩家", ""); skillObj sk2 = new skillObj(1, "放炸弹2", "在原地放一个炸弹,不会伤害到玩家2", ""); skillObj sk3 = new skillObj(2, "放炸弹3", "在原地放一个炸弹,不会伤害到玩家3", ""); idToSkillObj.Add(sk1.id, sk1); idToSkillObj.Add(sk2.id, sk2); idToSkillObj.Add(sk3.id, sk3); SkillBase sb = new Skill_1(); idToSkillBase.Add(sb.getSkillId(), sb); }
protected override void InitSkill() { /* * Skill_1 skill_1 = Instantiate(skill_1) as Skill_1; * Skill_2 skill_2 = Instantiate(skill_2) as Skill_2; * Skill_3 skill_3 = Instantiate(skill_3) as Skill_3; */ Skill_1 skill_1 = new Skill_1(); Skill_2 skill_2 = new Skill_2(); Skill_3 skill_3 = new Skill_3(); skill_list = new SkillBase[3]; skill_list[0] = skill_1; skill_list[1] = skill_2; skill_list[2] = skill_3; }