The Animator class is used to create animation components.

Animator 类用于创建动画组件。

层级 (查看层级一览, 展开)

实现

  • IClone

构造函数

属性

clipEnd: number = 1.0

The end time of the action playback.

动作播放结束时间。

clipStart: number = 0.0

Action playback start time.

动作播放起始时间

cycleOffset: number = 0

Play on awake start offset

启动时播放偏移

loop: number = -1

The number of animation loops. -1 or less than -1 to use the loop state of the clip, 1 for playing once, 2 for playing twice, 0 for infinite looping.

动画循环次数,-1或小于-1使用clip的循环状态,1表示播放一次,2表示播放两次,0表示无限循环。

name: string

name

名称

speed: number = 1.0

Animation playback speed

动画播放速度

yoyo: boolean = false

Is it a one-time forward playback and one-time reverse playback mode

是否为一次正播放,一次倒播放模式

访问器

方法

  • 参数

    • normalizeTime: number

      The normalized time for transition checking.

    • paramsMap: Record<string, Animation2DParm>

      The map of parameters for transition checking.

    • isReplay: boolean

      Whether to repeat playback.

    返回 AnimatorTransition2D

    Dispatches the transition event and checks for transitions based on normalized time and parameters.

    派发过渡事件并根据归一化时间和参数检查过渡。

  • 参数

    • type: string

      The type of event.

    • 可选data: any

      (Optional) Data to pass to the callback. If multiple parameters p1, p2, p3, ... need to be passed, use an array structure such as [p1, p2, p3, ...]. If a single parameter p needs to be passed and p is an array, use a structure such as [p]. For other single parameters p, you can directly pass parameter p. If data is Event.EMPTY, it means passing an Event object to the callback function. Note that it is not passing Event.TEMP, but an independent Event object.

    返回 boolean

    True if there are listeners for this event type, false otherwise.

    Dispatch an event.

    派发事件。

  • 参数

    • type: string

      The type of event.

    返回 boolean

    True if a listener of the specified type is registered, false otherwise.

    Check if the EventDispatcher object has any listeners registered for a specific type of event.

    检查 EventDispatcher 对象是否为特定事件类型注册了任何侦听器。

  • 参数

    • type: string

      The type of event.

    • listener: Function

      The listener function.

    返回 EventDispatcher

    This EventDispatcher object.

    Register an event listener object with the EventDispatcher object so that the listener receives event notifications.

    使用 EventDispatcher 对象注册指定类型的事件侦听器对象,以使侦听器能够接收事件通知。

  • 参数

    • type: string

      The type of event.

    • caller: any

      The execution scope of the event listener function.

    • listener: Function

      The listener function.

    • 可选args: any[]

      (Optional) The callback parameters of the event listener function.

    返回 EventDispatcher

    This EventDispatcher object.

    Register an event listener object with the EventDispatcher object so that the listener receives event notifications.

    使用 EventDispatcher 对象注册指定类型的事件侦听器对象,以使侦听器能够接收事件通知。

  • 参数

    • type: string

      The type of event.

    • listener: Function

      The listener function.

    返回 EventDispatcher

    This EventDispatcher object.

    Register an event listener object with the EventDispatcher object so that the listener receives event notifications. This event listener responds once and is automatically removed after the first call.

    使用 EventDispatcher 对象注册指定类型的事件侦听器对象,以使侦听器能够接收事件通知,此侦听事件响应一次后自动移除。

  • 参数

    • type: string

      The type of event.

    • caller: any

      The execution scope of the event listener function.

    • listener: Function

      The listener function.

    • 可选args: any[]

      (Optional) The callback parameters of the event listener function.

    返回 EventDispatcher

    This EventDispatcher object.

    Register an event listener object with the EventDispatcher object so that the listener receives event notifications. This event listener responds once and is automatically removed after the first call.

    使用 EventDispatcher 对象注册指定类型的事件侦听器对象,以使侦听器能够接收事件通知,此侦听事件响应一次后自动移除。

MMNEPVFCICPMFPCPTTAAATR