import { _decorator, CCBoolean, Component, game, Node, sp } from 'cc'; const { ccclass, property, requireComponent } = _decorator; @ccclass('SpineIgnoreTimeScale') @requireComponent(sp.Skeleton) export default class SpineIgnoreTimeScale extends Component { @property(CCBoolean) private ignoreTimeScale: boolean = false; private _skeleton: sp.Skeleton; protected onLoad(): void { this._skeleton = this.getComponent(sp.Skeleton); } protected update(dt: number): void { if (game.timeScale != 1) { this._skeleton.updateAnimation(this.ignoreTimeScale ? game.deltaTime : dt); } } }