开始重构技能系统
This commit is contained in:
@@ -45,7 +45,7 @@ export class Skill extends ecs.Entity {
|
||||
}
|
||||
|
||||
// 加载预制体
|
||||
const path = `game/skills/${config.sp_name}`;
|
||||
const path = `game/skill/atk/${config.sp_name}`;
|
||||
const prefab:Prefab = oops.res.get(path, Prefab);
|
||||
if (!prefab) {
|
||||
console.error("[Skill] 预制体加载失败:", path);
|
||||
|
||||
@@ -22,7 +22,6 @@ const { ccclass, property } = _decorator;
|
||||
export class SkillCom extends CCComp {
|
||||
// 核心标识和配置
|
||||
s_uuid:number = 0;
|
||||
|
||||
// 运行时状态(必须缓存的)
|
||||
is_destroy:boolean = false;
|
||||
startPos: Vec3 = v3(); // 起始位置
|
||||
@@ -81,14 +80,9 @@ export class SkillCom extends CCComp {
|
||||
this.initializeSkillConfig();
|
||||
if (!this.skillConfig) return;
|
||||
this.node.setPosition(this.startPos.x,this.startPos.y,0)
|
||||
|
||||
this.anim=this.node.getComponent(Animation)
|
||||
|
||||
this.on(GameEvent.MissionEnd, this.doDestroy, this);
|
||||
this.node.active = true;
|
||||
//console.log("[SkillCom]:caster",this.caster)
|
||||
|
||||
|
||||
let collider = this.getComponent(Collider2D);
|
||||
if(collider) {
|
||||
collider.group = this.group;
|
||||
|
||||
Reference in New Issue
Block a user