Breakroom is now Sinewave Campus. Book a meeting

SAnimatorStateInfo

客户端类型
在此类中IsName
  1. 函数
  2. IsName
  3. IsTag
  4. 属性
  5. fullPathHash
  6. nameHash
  7. shortNameHash
  8. normalizedTime
  9. length
  10. speed
  11. speedMultiplier
  12. tagHash
  13. loop
  14. Length
成员 12
函数IsNameDoes name match the name of the active state in the statemachine?
函数IsTagDoes tag match the tag of the active state in the statemachine.
属性fullPathHashThe full path hash for this state.
属性nameHashThe hashed name of the State.
属性shortNameHashThe hash is generated using SAnimator.StringToHash.
属性normalizedTimeNormalized time of the State.
属性lengthCurrent duration of the state.
属性speedThe playback speed of the animation. 1 is the normal playback speed.
属性speedMultiplier_The speed multiplier for this state.
属性tagHash_The Tag of the State.
属性loopIs the state looping.
属性LengthCurrent duration of the state.

函数​

IsName​

bool IsName(string name)

Does name match the name of the active state in the statemachine?

参数

名称类型默认值
namestring–

返回值

bool

示例

Lua
AnimationStateInfo = Space.Host.ExecutingObject.Animator.GetCurrentAnimationStateInfo(0)
AnimationStateInfo.isName("aStateName")

IsTag​

bool IsTag(string tag)

Does tag match the tag of the active state in the statemachine.

参数

名称类型默认值
tagstring–

返回值

bool

示例

Lua
AnimationStateInfo = Space.Host.ExecutingObject.Animator.GetCurrentAnimationStateInfo(0)
AnimationStateInfo.isTag("aStateTag")

属性​

fullPathHash只读​

int fullPathHash {get; }

The full path hash for this state. The hash is generated using Animator.StringToHash.

示例

Lua
AnimationStateInfo = Space.Host.ExecutingObject.Animator.GetCurrentAnimationStateInfo(0)
fullPathHash = AnimationStateInfo.fullPathHash

nameHash只读​

int nameHash {get; }

The hashed name of the State.

示例

Lua
AnimationStateInfo = Space.Host.ExecutingObject.Animator.GetCurrentAnimationStateInfo(0)
nameHash= AnimationStateInfo.nameHash

shortNameHash只读​

int shortNameHash {get; }

The hash is generated using SAnimator.StringToHash. The hash does not include the name of the parent layer.

示例

Lua
AnimationStateInfo = Space.Host.ExecutingObject.Animator.GetCurrentAnimationStateInfo(0)
shortNameHash= AnimationStateInfo.shortNameHash

normalizedTime只读​

float normalizedTime {get; }

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.

示例

Lua
AnimationStateInfo = Space.Host.ExecutingObject.Animator.GetCurrentAnimationStateInfo(0)
normalizedTime= AnimationStateInfo.normalizedTime

length只读​

float length {get; }

Current duration of the state. In seconds Can vary when the State contains a Blend Tree.

示例

Lua
AnimationStateInfo = Space.Host.ExecutingObject.Animator.GetCurrentAnimationStateInfo(0)
length= AnimationStateInfo.length

speed只读​

float speed {get; }

The playback speed of the animation. 1 is the normal playback speed. A negative playback speed will play the animation from the end.

示例

Lua
AnimationStateInfo = Space.Host.ExecutingObject.Animator.GetCurrentAnimationStateInfo(0)
speed= AnimationStateInfo.speed

speedMultiplier只读​

float speedMultiplier {get; }

_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._

示例

Lua
AnimationStateInfo = Space.Host.ExecutingObject.Animator.GetCurrentAnimationStateInfo(0)
speedMultiplier= AnimationStateInfo.speedMultiplier

tagHash只读​

int tagHash {get; }

_The Tag of the State.

The hash is generated using SAnimator.StringToHash._

示例

Lua
AnimationStateInfo = Space.Host.ExecutingObject.Animator.GetCurrentAnimationStateInfo(0)
tagHash= AnimationStateInfo.tagHash

loop只读​

bool loop {get; }

Is the state looping. All animations in the state must be looping.

示例

Lua
AnimationStateInfo = Space.Host.ExecutingObject.Animator.GetCurrentAnimationStateInfo(0)
loop= AnimationStateInfo.loop

Length只读​

float Length {get; }

Current duration of the state. In seconds Can vary when the State contains a Blend Tree

示例

Lua
AnimationStateInfo = Space.Host.ExecutingObject.Animator.GetCurrentAnimationStateInfo(0)
Length= AnimationStateInfo.Length