30 lines
979 B
TypeScript
30 lines
979 B
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
|
|
|
|
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/heros/role";
|
|
var prefab: Prefab = oops.res.get(path, Prefab)!;
|
|
var node = instantiate(prefab);
|
|
node.parent = parent;
|
|
node.setScale(node.scale.x, node.scale.y, node.scale.z);
|
|
node.setPosition(pos)
|
|
}
|
|
}
|