This commit is contained in:
pan@work
2024-09-27 16:07:56 +08:00
parent 027f527865
commit 2a88532ef4
12 changed files with 3422 additions and 2870 deletions

View File

@@ -0,0 +1,29 @@
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)
}
}

View File

@@ -0,0 +1,9 @@
{
"ver": "4.0.23",
"importer": "typescript",
"imported": true,
"uuid": "da2ee9b0-de45-487a-8c6b-f3ab67f8ff88",
"files": [],
"subMetas": {},
"userData": {}
}

View File

@@ -0,0 +1,29 @@
import { _decorator } from "cc";
import { ecs } from "../../../../extensions/oops-plugin-framework/assets/libs/ecs/ECS";
import { CCComp } from "../../../../extensions/oops-plugin-framework/assets/module/common/CCComp";
const { ccclass, property } = _decorator;
/** 视图层对象 */
@ccclass('TalentComp')
@ecs.register('TalentView', false)
export class TalentComp extends CCComp {
/** 视图层逻辑代码分离演示 */
start() {
// var entity = this.ent as ecs.Entity; // ecs.Entity 可转为当前模块的具体实体对象
// this.on(ModuleEvent.Cmd, this.onHandler, this);
}
/** 全局消息逻辑处理 */
// private onHandler(event: string, args: any) {
// switch (event) {
// case ModuleEvent.Cmd:
// break;
// }
// }
/** 视图对象通过 ecs.Entity.remove(ModuleViewComp) 删除组件是触发组件处理自定义释放逻辑 */
reset() {
this.node.destroy();
}
}

View File

@@ -0,0 +1,9 @@
{
"ver": "4.0.23",
"importer": "typescript",
"imported": true,
"uuid": "91d25bbb-9b90-479f-8e1b-b5624ee56aae",
"files": [],
"subMetas": {},
"userData": {}
}