技能移动修改

This commit is contained in:
2024-08-21 14:10:17 +08:00
parent 3f18763730
commit 76a7854e94
15 changed files with 161 additions and 104 deletions

View File

@@ -35,7 +35,7 @@ export class Hero extends ecs.Entity {
}
/** 加载角色 */
load(pos: Vec3 = Vec3.ZERO,camp:number = 1,uuid:number=1001) {
load(pos: Vec3 = Vec3.ZERO,scale:number = 1,uuid:number=1001) {
// var path = "game/monster/"+prefab_path;
var path = "game/heros/hero";
@@ -45,7 +45,7 @@ export class Hero extends ecs.Entity {
node.parent = scene.entityLayer!.node!;
// 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.getChildByName("avatar").setScale(node.getChildByName("avatar").scale.x*scale, node.getChildByName("avatar").scale.y, node.getChildByName("avatar").scale.z);
node.setPosition(pos)
// console.log(node.getChildByName("avatar").getChildByName("TNode").getChildByName("bb").getComponent(Sprite))
const url = 'game/heros/heros';
@@ -70,7 +70,7 @@ export class Hero extends ecs.Entity {
mv.power = smc.heros[uuid].power;
mv.type = smc.heros[uuid].type;
mv.Tpos = v3(0,0,0);
mv.camp = 1;
mv.scale = 1;
mv.change_name(smc.heros[uuid].name,1)
this.add(mv);
this.push_monsters_in(uuid,mv.ent.eid)