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