This is only for compatibility, and subsequent versions will set the density value in shape.
En
The density value. The value can be zero or a positive number. It is recommended to use similar densities to improve stacking stability. The default value is 10.
已被弃用
这个只做兼容,后续版本在shape中设置密度值大小.
Zh
密度值。值可以为零或者是正数,建议使用相似的密度以改善堆叠稳定性。默认值为 10。
set density(value): void
参数
value: number
返回 void
destroyed
get destroyed(): boolean
返回 boolean
En
whether the component has been destroyed.
Zh
组件是否已经被销毁。
enabled
get enabled(): boolean
返回 boolean
En
whether the component is enabled.
Zh
是否启用组件。
set enabled(value): void
参数
value: boolean
返回 void
friction
get friction(): number
返回 number
已被弃用
This is only for compatibility, and subsequent versions will set friction in the shape.
En
The friction coefficient. The value ranges from 0 to 1, the larger the value, the greater the friction. The default value is 0.2.
已被弃用
这个只做兼容,后续版本在shape中设置摩擦力.
Zh
摩擦力。取值范围0-1,值越大,摩擦越大。默认值为0.2。
set friction(value): void
参数
value: number
返回 void
hideFlags
get hideFlags(): number
返回 number
En
The hide flags that determine the hiding behavior of the component.
Zh
确定组件隐藏行为的标志。
set hideFlags(value): void
参数
value: number
返回 void
id
get id(): number
返回 number
En
The unique identifier for the component.
Zh
组件的唯一标识。
inertia
get inertia(): number
返回 number
En
The Rigidbody's resistance to changes in angular velocity (rotation).(Only valid when not using automatic mass calculation)
Zh
刚体惯性张量(只在未开启自动质量计算时才有效)
set inertia(value): void
参数
value: number
返回 void
isAwake
get isAwake(): boolean
返回 boolean
Zh
当前碰撞体在物理世界中是否在激活状态
set isAwake(value): void
参数
value: boolean
返回 void
isConnectedJoint
get isConnectedJoint(): boolean
返回 boolean
Zh
是否连接到关节
En
weather connect to joint
set isConnectedJoint(value): void
参数
value: boolean
返回 void
isSensor
get isSensor(): boolean
返回 boolean
已被弃用
This is only for compatibility. In subsequent versions, you can set whether the shape is a sensor.
En
Whether the object is a sensor. A sensor can trigger collision events but does not produce collision responses.
已被弃用
这个只做兼容,后续版本在shape中设置是否为传感器
Zh
是否是传感器,传感器能够触发碰撞事件,但不会产生碰撞反应
set isSensor(value): void
参数
value: boolean
返回 void
mass
get mass(): number
返回 number
En
The rigid body mass. (Only valid when not using automatic mass calculation)
Zh
刚体质量(只在未开启自动质量计算时才有效)
set mass(value): void
参数
value: number
返回 void
restitution
get restitution(): number
返回 number
已被弃用
En
The restitution coefficient. The value ranges from 0 to 1, the larger the value, the greater the elasticity. The default value is 0.
Checks if the component has a specific hide flag set.
Zh
检查组件是否设置了特定的隐藏标志。
onAdded
onAdded(): void
返回 void
En
Called after the component is added to a node. Unlike Awake, onAdded is called even if the node is not active.
Zh
组件被添加到节点后调用,与 onAwake 不同的是,即使节点未激活也会调用 onAdded。
Blueprint Event
onAwake
onAwake(): void
返回 void
En
Executed after the component is activated. At this point, all nodes and components have been created. This method is executed only once.
Zh
组件被激活后执行,此时所有节点和组件均已创建完毕,此方法只执行一次。
Blueprint Event
onDestroy
onDestroy(): void
返回 void
En
Executed when the node is destroyed manually.
Zh
手动调用节点销毁时执行。
Blueprint Event
onDisable
onDisable(): void
返回 void
En
Executed when the component is disabled, such as when the node is removed from the stage.
Zh
组件被禁用时执行,比如从节点从舞台移除后。
Blueprint Event
onEnable
onEnable(): void
返回 void
En
Executed after the component is enabled, such as when the node is added to the stage.
Zh
组件被启用后执行,比如节点被添加到舞台后。
Blueprint Event
可选onLateUpdate
onLateUpdate(): void
返回 void
En
Executed every frame during the late update phase, after the update phase.
Zh
每帧更新时执行,在 late update 阶段,update 阶段之后。
Blueprint Event
可选onPostRender
onPostRender(): void
返回 void
En
Executed after rendering.
Zh
渲染之后执行。
Blueprint Event
可选onPreRender
onPreRender(): void
返回 void
En
Executed before rendering.
Zh
渲染之前执行。
Blueprint Event
可选onReset
onReset(): void
返回 void
En
Resets the component's parameters to their default values. If this function is implemented, the component will be reset and automatically recycled for future use.
If not reset, it will not be recycled for reuse.
En
2Dphysics Static Collider
Zh
2D物理静态碰撞体