跳到主要内容

goto 跳转到指定帧

goto

类型: MethodDeclaration

所属类: AnimationPlayer

定义位置: animation.ts

描述

跳转到指定帧

参数 index: 帧索引

参数

参数名类型描述默认值
indexnumber--

返回值

类型: void

源代码

位置: 第 153 行

public goto(index: number): void {
index = Math.clamp(index, 0, this.length - 1)
// 跳转到前面的动画帧时增加循环计数
if (index < this.index) {
this.cycleIndex++
}
this.index = index
this.ended = false
}

文档生成时间:2025/7/7 12:07:06