API / AnimationState
Class: AnimationState
Defined in: animation/AnimationState.ts:40
The animation state is generated when the animation data is played.
Extends
Constructors
Constructor
new AnimationState(): AnimationState;
Returns
AnimationState
Inherited from
Properties
_actionTimeline
_actionTimeline: ActionTimelineState;
Defined in: animation/AnimationState.ts:213
Internal
_duration
_duration: number;
Defined in: animation/AnimationState.ts:188
Internal
_fadeProgress
_fadeProgress: number;
Defined in: animation/AnimationState.ts:195
Internal
_fadeState
_fadeState: number;
Defined in: animation/AnimationState.ts:175
Internal
-1: Fade in, 0: Fade complete, 1: Fade out;
_parent
_parent: AnimationState;
Defined in: animation/AnimationState.ts:220
Internal
_playheadState
_playheadState: number;
Defined in: animation/AnimationState.ts:170
Internal
- xx: Play Enabled, Fade Play Enabled
_position
_position: number;
Defined in: animation/AnimationState.ts:184
Internal
_subFadeState
_subFadeState: number;
Defined in: animation/AnimationState.ts:180
Internal
-1: Fade start, 0: Fading, 1: Fade complete;
_weightResult
_weightResult: number;
Defined in: animation/AnimationState.ts:199
Internal
autoFadeOutTime
autoFadeOutTime: number;
Defined in: animation/AnimationState.ts:140
The auto fade out time when the animation state play completed. [-1: Do not fade out automatically, [0~N]: The fade out time] (In seconds)
Default
-1.0
displayControl
displayControl: boolean;
Defined in: animation/AnimationState.ts:64
Whether the animation state has control over the display object properties of the slots. Sometimes blend a animation state does not want it to control the display object properties of the slots, especially if other animation state are controlling the display object properties of the slots.
Default
true
group
readonly group: string;
Defined in: animation/AnimationState.ts:164
The blend group name of the animation state. This property is typically used to specify the substitution of multiple animation states blend.
hashCode
readonly hashCode: number;
Defined in: core/BaseObject.ts:156
A unique identification number assigned to the object.
Inherited from
layer
readonly layer: number;
Defined in: animation/AnimationState.ts:100
The blend layer. High layer animation state will get the blend weight first. When the blend weight is assigned more than 1, the remaining animation states will no longer get the weight assigned.
name
readonly name: string;
Defined in: animation/AnimationState.ts:153
The name of the animation state. (Can be different from the name of the animation data)
playTimes
playTimes: number;
Defined in: animation/AnimationState.ts:87
The play times. [0: Loop play, [1~N]: Play N times]
resetToPose
resetToPose: boolean;
Defined in: animation/AnimationState.ts:75
Whether to reset the objects without animation to the armature pose when the animation state is start to play. This property should usually be set to false when blend multiple animation states.
Default
true
timeScale
timeScale: number;
Defined in: animation/AnimationState.ts:113
The play speed. The value is an overlay relationship with Animation#timeScale. [(-N~0): Reverse play, 0: Stop play, (0~1): Slow play, 1: Normal play, (1~N): Fast play]
Default
1.0
Accessors
animationData
Get Signature
get animationData(): AnimationData;
Defined in: animation/AnimationState.ts:1446
The animation data.
Returns
currentPlayTimes
Get Signature
get currentPlayTimes(): number;
Defined in: animation/AnimationState.ts:1350
The times has been played.
Returns
number
currentTime
Get Signature
get currentTime(): number;
Defined in: animation/AnimationState.ts:1370
The time is currently playing. (In seconds)
Returns
number
Set Signature
set currentTime(value: number): void;
Defined in: animation/AnimationState.ts:1373
Parameters
Parameter | Type |
---|---|
value | number |
Returns
void
isCompleted
Get Signature
get isCompleted(): boolean;
Defined in: animation/AnimationState.ts:1340
Whether the animation state is play completed.
Returns
boolean
isFadeComplete
Get Signature
get isFadeComplete(): boolean;
Defined in: animation/AnimationState.ts:1320
Whether the animation state is fade completed.
Returns
boolean
isFadeIn
Get Signature
get isFadeIn(): boolean;
Defined in: animation/AnimationState.ts:1300
Whether the animation state is fading in.
Returns
boolean
isFadeOut
Get Signature
get isFadeOut(): boolean;
Defined in: animation/AnimationState.ts:1310
Whether the animation state is fading out.
Returns
boolean
isPlaying
Get Signature
get isPlaying(): boolean;
Defined in: animation/AnimationState.ts:1330
Whether the animation state is playing.
Returns
boolean
totalTime
Get Signature
get totalTime(): number;
Defined in: animation/AnimationState.ts:1360
The total time. (In seconds)
Returns
number
weight
Get Signature
get weight(): number;
Defined in: animation/AnimationState.ts:1416
The blend weight.
Default
1.0
Returns
number
Set Signature
set weight(value: number): void;
Defined in: animation/AnimationState.ts:1419
Parameters
Parameter | Type |
---|---|
value | number |
Returns
void
Methods
activeTimeline()
activeTimeline(): void;
Defined in: animation/AnimationState.ts:1287
Internal
Returns
void
addBoneMask()
addBoneMask(boneName: string, recursive: boolean): void;
Defined in: animation/AnimationState.ts:1155
Add a specific bone mask.
Parameters
Parameter | Type | Default value | Description |
---|---|---|---|
boneName | string | undefined | The bone name. |
recursive | boolean | true | Whether or not to add a mask to the bone's sub-bone. |
Returns
void
advanceTime()
advanceTime(passedTime: number, cacheFrameRate: number): void;
Defined in: animation/AnimationState.ts:779
Internal
Parameters
Parameter | Type |
---|---|
passedTime | number |
cacheFrameRate | number |
Returns
void
containsBoneMask()
containsBoneMask(boneName: string): boolean;
Defined in: animation/AnimationState.ts:1139
Check if a specific bone mask is included.
Parameters
Parameter | Type | Description |
---|---|---|
boneName | string | The bone name. |
Returns
boolean
fadeOut()
fadeOut(fadeOutTime: number, pausePlayhead: boolean): void;
Defined in: animation/AnimationState.ts:1075
Fade out the animation state.
Parameters
Parameter | Type | Default value | Description |
---|---|---|---|
fadeOutTime | number | undefined | The fade out time. (In seconds) |
pausePlayhead | boolean | true | Whether to pause the animation playing when fade out. |
Returns
void
init()
init(
armature: Armature,
animationData: AnimationData,
animationConfig: AnimationConfig): void;
Defined in: animation/AnimationState.ts:696
Internal
Parameters
Parameter | Type |
---|---|
armature | Armature |
animationData | AnimationData |
animationConfig | AnimationConfig |
Returns
void
play()
play(): void;
Defined in: animation/AnimationState.ts:1049
Continue play.
Returns
void
removeAllBoneMask()
removeAllBoneMask(): void;
Defined in: animation/AnimationState.ts:1229
Remove all bone masks.
Returns
void
removeBoneMask()
removeBoneMask(boneName: string, recursive: boolean): void;
Defined in: animation/AnimationState.ts:1188
Remove the mask of a specific bone.
Parameters
Parameter | Type | Default value | Description |
---|---|---|---|
boneName | string | undefined | The bone name. |
recursive | boolean | true | Whether to remove the bone's sub-bone mask. |
Returns
void
returnToPool()
returnToPool(): void;
Defined in: core/BaseObject.ts:167
Clear the object and return it back to object pool。
Returns
void
Inherited from
stop()
stop(): void;
Defined in: animation/AnimationState.ts:1059
Stop play.
Returns
void
borrowObject()
static borrowObject<T>(objectConstructor: () => T): T;
Defined in: core/BaseObject.ts:136
Get an instance of the specify class from object pool.
Type Parameters
Type Parameter |
---|
T extends BaseObject |
Parameters
Parameter | Type | Description |
---|---|---|
objectConstructor | () => T | The specify class. |
Returns
T
Inherited from
clearPool()
static clearPool(objectConstructor: typeof BaseObject): void;
Defined in: core/BaseObject.ts:111
Clear the cached instances of a specify object pool.
Parameters
Parameter | Type | Default value | Description |
---|---|---|---|
objectConstructor | typeof BaseObject | null | Specify class. (Clear all cached instances if not set) |
Returns
void
Inherited from
setMaxCount()
static setMaxCount(objectConstructor: typeof BaseObject, maxCount: number): void;
Defined in: core/BaseObject.ts:72
Set the maximum cache count of the specify object pool.
Parameters
Parameter | Type | Description |
---|---|---|
objectConstructor | typeof BaseObject | The specify class. (Set all object pools max cache count if not set) |
maxCount | number | Max count. |
Returns
void
Inherited from
toString()
static toString(): string;
Defined in: animation/AnimationState.ts:41
Returns
string