35 lines
1.1 KiB
TypeScript
35 lines
1.1 KiB
TypeScript
import { instantiate, Prefab, Vec3 ,Node} from "cc";
|
|
import { ecs } from "../../../../extensions/oops-plugin-framework/assets/libs/ecs/ECS";
|
|
import { TalentComp } from "./TalentComp";
|
|
import { oops } from "../../../../extensions/oops-plugin-framework/assets/core/Oops";
|
|
import { smc } from "../common/SingletonModuleComp";
|
|
|
|
/** Talent 模块 */
|
|
@ecs.register(`Talent`)
|
|
export class Talent extends ecs.Entity {
|
|
/** ---------- 数据层 ---------- */
|
|
|
|
TalentView!: TalentComp
|
|
protected init() {
|
|
|
|
}
|
|
destroy(): void {
|
|
this.remove(TalentComp);
|
|
super.destroy();
|
|
}
|
|
|
|
/** 加载角色 */
|
|
load(pos: Vec3 = Vec3.ZERO,uuid:number=101,parent:Node) {
|
|
// var path = "game/monster/"+prefab_path;
|
|
var path = "game/talent";
|
|
var prefab: Prefab = oops.res.get(path, Prefab)!;
|
|
var node = instantiate(prefab);
|
|
node.parent = parent;
|
|
node.setPosition(pos)
|
|
console.log("load_talent",node)
|
|
let tv = node.getComponent(TalentComp)!;
|
|
tv.t_uuid = uuid;
|
|
this.add(tv);
|
|
}
|
|
}
|