This commit is contained in:
2024-08-02 17:06:21 +08:00
parent 52cefb71b4
commit d5f2f65ee6
22 changed files with 920 additions and 75 deletions

View File

@@ -23,7 +23,22 @@ export default class MonsterSpineAnimator extends Component {
// console.log("MonsterSpineAnimator start");
this.playAnimation(this.animName, this.loop);
}
mixTime:number= 0.2;
protected onLoad(): void {
this.spine = this.getComponent(sp.Skeleton)!;
// this.spine?.setMix('atk', 'move', this.mixTime);
// this.spine?.setMix('move','atk', this.mixTime);
this.spine.setEndListener(trackEntry => {
var animationName = trackEntry.animation ? trackEntry.animation.name : "";
// console.log("[track %s][animation %s] end.", trackEntry.trackIndex, animationName);
if (animationName == "atk") {
this.spine.setAnimation(0, "move", true);
}
});
}
lateUpdate(dt: number) {
//
}