跳到主要内容

setAngle 设置角度

setAngle

类型: MethodDeclaration

所属类: CommandFunctionList

定义位置: command.ts

描述

设置角度

参数

参数名类型描述默认值
\{actor, angle, easingId, duration, wait\}`{
actor: ActorGetter
angle: AngleGetter
easingId: string
duration: number | VariableGetter
wait: boolean
}`--

返回值

类型: CommandFunction

源代码

位置: 第 5849 行

protected setAngle({actor, angle, easingId, duration, wait}: {
actor: ActorGetter
angle: AngleGetter
easingId: string
duration: number | VariableGetter
wait: boolean
}): CommandFunction {
const getActor = Command.compileActor(actor)
const getAngle = Command.compileAngle(angle)
const getDuration = Command.compileNumber(duration)
return () => {
const actor = getActor()
if (actor) {
const radians = getAngle(actor)
const duration = getDuration()
actor.setAngle(radians, easingId, duration)
if (wait && duration > 0) {
return CurrentEvent.wait(duration)
}
}
return true
}
}

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