This commit is contained in:
2025-03-17 23:18:29 +08:00
parent 610f66de38
commit eb20011f07
24 changed files with 6379 additions and 6330 deletions

View File

@@ -0,0 +1,33 @@
import { _decorator, v3, Vec3 } from "cc";
import { ecs } from "../../../../extensions/oops-plugin-framework/assets/libs/ecs/ECS";
import { CCComp } from "../../../../extensions/oops-plugin-framework/assets/module/common/CCComp";
import { HCard } from "./HCard";
import { BoxSet } from "../common/config/BoxSet";
import { HeroSet } from "../common/config/heroSet";
import { Hero } from "../hero/Hero";
const { ccclass, property } = _decorator;
/** 视图层对象 */
@ccclass('MissionHeroCompComp')
@ecs.register('MissionHeroComp', false)
export class MissionHeroCompComp extends CCComp {
/** 视图层逻辑代码分离演示 */
start() {
// var entity = this.ent as ecs.Entity; // ecs.Entity 可转为当前模块的具体实体对象
// this.on(ModuleEvent.Cmd, this.onHandler, this);
}
/** 添加玩家 */
private addHero(uuid:number=1001,i:number=0) {
let hero = ecs.getEntity<Hero>(Hero);
let scale = 1
let pos:Vec3 = v3(HeroSet.StartPos[1]-i*10,BoxSet.GAME_LINE);
hero.load(pos,scale,uuid);
}
/** 视图对象通过 ecs.Entity.remove(ModuleViewComp) 删除组件是触发组件处理自定义释放逻辑 */
reset() {
this.node.destroy();
}
}