refactor(hero): 重构技能系统变量命名和自动施法系统
将技能相关变量名从skillId改为s_uuid以提高一致性 重命名自动施法系统文件并优化目标选择方法命名 删除旧版自动施法系统文件,新增重构后的实现
This commit is contained in:
@@ -37,14 +37,14 @@ export class HeroSkillsComp extends ecs.Comp {
|
||||
|
||||
/**
|
||||
* 初始化技能列表
|
||||
* @param skillIds 技能配置ID数组
|
||||
* @param sUuids 技能配置ID数组
|
||||
*/
|
||||
initSkills(skillIds: number[]) {
|
||||
initSkills(sUuids: number[]) {
|
||||
this.skills = [];
|
||||
for (const skillId of skillIds) {
|
||||
const config = SkillSet[skillId];
|
||||
for (const s_uuid of sUuids) {
|
||||
const config = SkillSet[s_uuid];
|
||||
if (!config) {
|
||||
console.warn(`[HeroSkills] 技能配置不存在: ${skillId}`);
|
||||
console.warn(`[HeroSkills] 技能配置不存在: ${s_uuid}`);
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -61,10 +61,10 @@ export class HeroSkillsComp extends ecs.Comp {
|
||||
/**
|
||||
* 添加单个技能
|
||||
*/
|
||||
addSkill(skillId: number) {
|
||||
const config = SkillSet[skillId];
|
||||
addSkill(s_uuid: number) {
|
||||
const config = SkillSet[s_uuid];
|
||||
if (!config) {
|
||||
console.warn(`[HeroSkills] 技能配置不存在: ${skillId}`);
|
||||
console.warn(`[HeroSkills] 技能配置不存在: ${s_uuid}`);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user