SAnimatorStateInfo
| 函数 | IsName | Does name match the name of the active state in the statemachine? |
| 函数 | IsTag | Does tag match the tag of the active state in the statemachine. |
| 属性 | fullPathHash | The full path hash for this state. |
| 属性 | nameHash | The hashed name of the State. |
| 属性 | shortNameHash | The hash is generated using SAnimator.StringToHash. |
| 属性 | normalizedTime | Normalized time of the State. |
| 属性 | length | Current duration of the state. |
| 属性 | speed | The playback speed of the animation. 1 is the normal playback speed. |
| 属性 | speedMultiplier | _The speed multiplier for this state. |
| 属性 | tagHash | _The Tag of the State. |
| 属性 | loop | Is the state looping. |
| 属性 | Length | Current duration of the state. |
函数
IsName
Does name match the name of the active state in the statemachine?
参数
| 名称 | 类型 | 默认值 |
|---|---|---|
| name | string | – |
返回值
bool
示例
AnimationStateInfo = Space.Host.ExecutingObject.Animator.GetCurrentAnimationStateInfo(0)
AnimationStateInfo.isName("aStateName")
IsTag
Does tag match the tag of the active state in the statemachine.
参数
| 名称 | 类型 | 默认值 |
|---|---|---|
| tag | string | – |
返回值
bool
示例
AnimationStateInfo = Space.Host.ExecutingObject.Animator.GetCurrentAnimationStateInfo(0)
AnimationStateInfo.isTag("aStateTag")
属性
fullPathHash只读
The full path hash for this state. The hash is generated using Animator.StringToHash.
示例
AnimationStateInfo = Space.Host.ExecutingObject.Animator.GetCurrentAnimationStateInfo(0)
fullPathHash = AnimationStateInfo.fullPathHash
nameHash只读
The hashed name of the State.
示例
AnimationStateInfo = Space.Host.ExecutingObject.Animator.GetCurrentAnimationStateInfo(0)
nameHash= AnimationStateInfo.nameHash
shortNameHash只读
The hash is generated using SAnimator.StringToHash. The hash does not include the name of the parent layer.
示例
AnimationStateInfo = Space.Host.ExecutingObject.Animator.GetCurrentAnimationStateInfo(0)
shortNameHash= AnimationStateInfo.shortNameHash
normalizedTime只读
Normalized time of the State. The integer part is the number of time a state has been looped. The fractional part is the % (0-1) of progress in the current loop.
示例
AnimationStateInfo = Space.Host.ExecutingObject.Animator.GetCurrentAnimationStateInfo(0)
normalizedTime= AnimationStateInfo.normalizedTime
length只读
Current duration of the state. In seconds Can vary when the State contains a Blend Tree.
示例
AnimationStateInfo = Space.Host.ExecutingObject.Animator.GetCurrentAnimationStateInfo(0)
length= AnimationStateInfo.length
speed只读
The playback speed of the animation. 1 is the normal playback speed. A negative playback speed will play the animation from the end.
示例
AnimationStateInfo = Space.Host.ExecutingObject.Animator.GetCurrentAnimationStateInfo(0)
speed= AnimationStateInfo.speed
speedMultiplier只读
_The speed multiplier for this state.
A negative speed multiplier will play the animation backwards. If no speed parameter as been set for this SAnimatorState, the default value will be 1._
示例
AnimationStateInfo = Space.Host.ExecutingObject.Animator.GetCurrentAnimationStateInfo(0)
speedMultiplier= AnimationStateInfo.speedMultiplier
tagHash只读
_The Tag of the State.
The hash is generated using SAnimator.StringToHash._
示例
AnimationStateInfo = Space.Host.ExecutingObject.Animator.GetCurrentAnimationStateInfo(0)
tagHash= AnimationStateInfo.tagHash
loop只读
Is the state looping. All animations in the state must be looping.
示例
AnimationStateInfo = Space.Host.ExecutingObject.Animator.GetCurrentAnimationStateInfo(0)
loop= AnimationStateInfo.loop
Length只读
Current duration of the state. In seconds Can vary when the State contains a Blend Tree
示例
AnimationStateInfo = Space.Host.ExecutingObject.Animator.GetCurrentAnimationStateInfo(0)
Length= AnimationStateInfo.Length



