局内技能 初步

This commit is contained in:
2024-11-19 16:51:40 +08:00
parent 968dbdcc04
commit d930cb1b81
18 changed files with 966 additions and 1331 deletions

View File

@@ -0,0 +1,30 @@
import { instantiate, Prefab } from "cc";
import { ecs } from "../../../../extensions/oops-plugin-framework/assets/libs/ecs/ECS";
import { oops } from "../../../../extensions/oops-plugin-framework/assets/core/Oops";
import { MSkillComp } from "./MSkillComp";
/** MSkill 模块 */
@ecs.register(`MSkill`)
export class MSkill extends ecs.Entity {
/** 实始添加的数据层组件 */
protected init() {
// this.addComponents<ecs.Comp>();
}
load(uuid:number=1001,index:number=-1,parent:any) {
let box_group= 0
var path = "game/skills/mskill";
var prefab: Prefab = oops.res.get(path, Prefab)!;
var node = instantiate(prefab);
node.parent = parent
var msc = node.getComponent(MSkillComp)!;
this.add(msc)
}
/** 模块资源释放 */
destroy() {
// 注: 自定义释放逻辑,视图层实现 ecs.IComp 接口的 ecs 组件需要手动释放
super.destroy();
}
}