[phaser] Add before and after update world transforms callbacks.

This commit is contained in:
Mario Zechner 2023-04-26 10:53:01 +02:00
parent 5662c75db9
commit a996baa2b0

View File

@ -80,6 +80,8 @@ export class SpineGameObject extends ComputedSizeMixin(DepthMixin(FlipMixin(Scro
skeleton: Skeleton;
animationStateData: AnimationStateData;
animationState: AnimationState;
beforeUpdateWorldTransforms: (object: SpineGameObject) => void = () => {};
afterUpdateWorldTransforms: (object: SpineGameObject) => void = () => {};
private premultipliedAlpha = false;
private _displayOriginX = 0;
private _displayOriginY = 0;
@ -175,7 +177,9 @@ export class SpineGameObject extends ComputedSizeMixin(DepthMixin(FlipMixin(Scro
this.animationState.update(delta / 1000);
this.animationState.apply(this.skeleton);
this.beforeUpdateWorldTransforms(this);
this.skeleton.updateWorldTransform();
this.afterUpdateWorldTransforms(this);
}
preDestroy () {