技能移动修改

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

@@ -25,7 +25,7 @@ export class CSkill 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;
console.log("load skill",this)
var path = "game/heros/skill";
@@ -33,7 +33,7 @@ export class CSkill extends ecs.Entity {
var node = instantiate(prefab);
var scene = smc.map.MapView.scene;
node.parent = scene.entityLayer!.node!;
node.getChildByName("skill").setScale(node.getChildByName("skill").scale.x*camp, node.getChildByName("skill").scale.y, node.getChildByName("skill").scale.z);
node.getChildByName("skill").setScale(node.getChildByName("skill").scale.x*scale, node.getChildByName("skill").scale.y, node.getChildByName("skill").scale.z);
let cskills = ecs.query(ecs.allOf(CSkillComp))
for (let index = 1; index <= 8; index++) {
if(smc.player_buffs[index].eid == 0){
@@ -45,7 +45,7 @@ export class CSkill extends ecs.Entity {
}
console.log("load skill",pos,smc.player_buffs)
node.setPosition(pos.x*-camp,pos.y,pos.z)
node.setPosition(pos.x*scale,pos.y,pos.z)
// console.log(node.getChildByName("avatar").getChildByName("TNode").getChildByName("bb").getComponent(Sprite))
const url = 'game/heros/skill';
resources.load(url, SpriteAtlas, (err: any, atlas) => {
@@ -59,7 +59,7 @@ export class CSkill extends ecs.Entity {
skill_init(uuid:number=1001,node:Node,pos:Vec3=v3(0,0,0)){
var mv = node.getComponent(CSkillComp)
mv.camp = 1;
mv.scale = 1;
this.add(mv);
}