fix type definition of animation functions

This commit is contained in:
printempw 2018-02-12 10:16:26 +08:00
parent b616ce8cf2
commit 8f9127777e
2 changed files with 4 additions and 4 deletions

View File

@ -15,7 +15,7 @@ class AnimationHandle {
this.speed = this._speed = 1.0;
this._lastChange = null;
this._lastChangeX = null;
this._animationNaturalSpeed = animation.naturalSpeed;
this._animationNaturalSpeed = animation.naturalSpeed || 1.0;
}
play(player, time) {
if (this._lastChange === null) {

View File

@ -28,6 +28,6 @@ export class CompositeAnimation implements IAnimation {
public play(player: PlayerObject, time: number): void;
}
export const WalkAnimation: AnimationFn;
export const RunningAnimation: AnimationFn;
export const RotatingAnimation: AnimationFn;
export const WalkingAnimation: AnimationFn & { naturalSpeed?: number };
export const RunningAnimation: AnimationFn & { naturalSpeed?: number };
export const RotatingAnimation: AnimationFn & { naturalSpeed?: number };