提供对SpriteAnimator中的一些字段的访问
This commit is contained in:
1
source/bin/framework.d.ts
vendored
1
source/bin/framework.d.ts
vendored
@@ -434,6 +434,7 @@ declare class SpriteAnimator extends SpriteRenderer {
|
||||
currentAnimationName: string;
|
||||
currentFrame: number;
|
||||
readonly isRunning: boolean;
|
||||
readonly animations: Map<string, SpriteAnimation>;
|
||||
private _animations;
|
||||
private _elapsedTime;
|
||||
private _loopMode;
|
||||
|
||||
@@ -2007,6 +2007,13 @@ var SpriteAnimator = (function (_super) {
|
||||
enumerable: true,
|
||||
configurable: true
|
||||
});
|
||||
Object.defineProperty(SpriteAnimator.prototype, "animations", {
|
||||
get: function () {
|
||||
return this._animations;
|
||||
},
|
||||
enumerable: true,
|
||||
configurable: true
|
||||
});
|
||||
SpriteAnimator.prototype.addAnimation = function (name, animation) {
|
||||
if (!this.sprite && animation.sprites.length > 0)
|
||||
this.setSprite(animation.sprites[0]);
|
||||
|
||||
2
source/bin/framework.min.js
vendored
2
source/bin/framework.min.js
vendored
File diff suppressed because one or more lines are too long
@@ -17,6 +17,10 @@ class SpriteAnimator extends SpriteRenderer {
|
||||
return this.animationState == State.running;
|
||||
}
|
||||
|
||||
/** 提供对可用动画列表的访问 */
|
||||
public get animations(){
|
||||
return this._animations;
|
||||
}
|
||||
private _animations: Map<string, SpriteAnimation> = new Map<string, SpriteAnimation>();
|
||||
private _elapsedTime: number = 0;
|
||||
private _loopMode: LoopMode;
|
||||
|
||||
Reference in New Issue
Block a user