dd zindex 调整一完成,优化技能动画

This commit is contained in:
2024-09-13 09:02:06 +08:00
parent 221d91a795
commit 72839d9f9f
30 changed files with 145 additions and 247 deletions

View File

@@ -145,13 +145,11 @@ export class HeroViewComp extends CCComp {
}
onPreSolve (selfCollider: Collider2D, otherCollider: Collider2D) {
if(selfCollider.group == otherCollider.group&&selfCollider.tag==otherCollider.tag){
console.log("onBeginContact tag "+selfCollider.tag+otherCollider.tag)
if(selfCollider.node.position.y < otherCollider.node.position.y){
if(selfCollider.node.getSiblingIndex() < otherCollider.node.getSiblingIndex()){
console.log("onPreSolve",selfCollider.node,otherCollider.node)
console.log("onPreSolve f:"+selfCollider.node.uuid+":"+selfCollider.node.getSiblingIndex()+"/"+otherCollider.node.uuid+":"+otherCollider.node.getSiblingIndex());
selfCollider.node.setSiblingIndex(otherCollider.node.getSiblingIndex()+1)
console.log("onPreSolve b:"+selfCollider.node.uuid+":"+selfCollider.node.getSiblingIndex()+"/"+otherCollider.node.uuid+":"+otherCollider.node.getSiblingIndex());
// console.log("onPreSolve b:"+selfCollider.node.uuid+":"+selfCollider.node.getSiblingIndex()+"/"+otherCollider.node.uuid+":"+otherCollider.node.getSiblingIndex());
}
}
@@ -201,38 +199,7 @@ export class HeroViewComp extends CCComp {
var move = this.ent.get(MoveToComp) || this.ent.add(MoveToComp);
move.target = v3(smc.Role.RoleView.node.position.x+10,smc.Role.RoleView.node.position.y);
move.node = this.node;
move.speed = this.ospeed;
// if(this.box_group == BoxSet.MON){
// if(smc.t_hero.eid != 0){
// var move = this.ent.get(MoveToComp) || this.ent.add(MoveToComp);
// if(smc.t_hero.pos.x < this.node.position.x){
// // this.node.setScale(-Math.abs(this.node.scale.x),this.node.scale.y)
// move.target = v3(smc.t_hero.pos.x+20,smc.t_hero.pos.y);
// }else{
// // this.node.setScale(Math.abs(this.node.scale.x),this.node.scale.y)
// move.target = v3(smc.t_hero.pos.x-20,smc.t_hero.pos.y);
// }
// move.node = this.node;
// move.speed = this.ospeed;
// }
// }
// if(this.box_group == BoxSet.HERO){
// if(smc.t_mon.eid != 0){
// var move = this.ent.get(MoveToComp) || this.ent.add(MoveToComp);
// if(smc.t_mon.pos.x < this.node.position.x){
// // this.node.setScale(-Math.abs(this.node.scale.x),this.node.scale.y)
// move.target = v3(smc.t_mon.pos.x+20,smc.t_mon.pos.y);
// }else{
// // this.node.setScale(Math.abs(this.node.scale.x),this.node.scale.y)
// move.target = v3(smc.t_mon.pos.x-20,smc.t_mon.pos.y);
// }
// move.node = this.node;
// move.speed = this.ospeed;
// }
// }
move.speed = this.ospeed;
}
power_change(power: number){
this.power += power;