霸气2段技能存在问题, 加血buff 特效一直存在, 这2个问题需要解决

This commit is contained in:
2025-01-17 10:45:14 +08:00
parent 65b03af516
commit 82d012796f
6 changed files with 717 additions and 377 deletions

View File

@@ -11,8 +11,22 @@ export class seCom extends Component {
start() {
this.base =this.node.getComponent(SkillCom)
let anim = this.node.getComponent(Animation);
anim.on(Animation.EventType.FINISHED, this.onAnimationFinished, this);
if(this.node.getComponent(Animation)){
let anim = this.node.getComponent(Animation);
console.log("has anim",anim)
anim.on(Animation.EventType.FINISHED, this.onAnimationFinished, this);
}
if(this.node.getChildByName('anm')){
if(this.node.getChildByName('anm').getComponent('sp.Skeleton')){
var spine = this.node.getChildByName('anm').getComponent('sp.Skeleton') as sp.Skeleton;
console.log("has spine",spine)
spine.setCompleteListener((trackEntry) => {
this.onAnimationFinished()
console.log("[track %s][animation %s] complete: %s", trackEntry.trackIndex);
});
}
}
}
update(deltaTime: number) {