Skip to main content

setWeight 设置体重

setWeight​

类型: MethodDeclaration

所属类: ActorCollider

定义位置: actor.ts

描述​

设置体重

参数 weight: 碰撞器体重

参数​

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

返回值​

类型: void

源代码​

位置: 第 1529 行

public setWeight(weight: number): void {
this.weight = weight;
// 更新角色的障碍区域
this.actor.parent?.scene.obstacle.update(this.actor);
}

文档生成时间:2026/2/1 16:51:38