卡牌技能

This commit is contained in:
walkpan
2024-08-21 08:40:25 +08:00
parent b9edfd7001
commit fa8a2d1c6d
23 changed files with 1279 additions and 264 deletions

View File

@@ -14,23 +14,23 @@ import { smc } from "../common/SingletonModuleComp";
import { MonsterModelComp } from "./MonsterModelComp";
import { MonsterSpine } from "./MonsterSpine";
import { MonsterViewComp } from "./MonsterViewComp";
import {HeroModelComp} from "./HeroModelComp";
import { CardSet } from "../common/config/CardSet";
/** 角色实体 */
@ecs.register(`Hero`)
export class Hero extends ecs.Entity {
// 数据层
MonsterModel!: MonsterModelComp;
HeroModel!: HeroModelComp;
// 视图层
MonsterView!: MonsterViewComp;
protected init() {
this.addComponents<ecs.Comp>(
MonsterModelComp);
this.addComponents<ecs.Comp>(HeroModelComp);
}
destroy(): void {
this.remove(MonsterViewComp);
this.remove(MonsterModelComp);
super.destroy();
}
@@ -43,7 +43,7 @@ export class Hero extends ecs.Entity {
var node = instantiate(prefab);
var scene = smc.map.MapView.scene;
node.parent = scene.entityLayer!.node!;
var as = node.getComponent(MonsterSpine);
// var as = node.getComponent(MonsterSpine);
node.getChildByName("avatar").setScale(node.getChildByName("avatar").scale.x*camp, node.getChildByName("avatar").scale.y, node.getChildByName("avatar").scale.z);
node.setPosition(pos)