This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
component:motion_sensor:zh [2023/11/15 15:01] hfsr created |
component:motion_sensor:zh [2023/12/27 03:10] (current) hfsr [组件:运动传感器] |
||
---|---|---|---|
Line 1: | Line 1: | ||
- | Component: Motion Sensor | + | 组件:运动传感器 |
============== | ============== | ||
- | This is the component provided by the [[block:motion_sensor|Motion Sensor]]. When an entity within line of sight of the [[block:motion_sensor|Motion Sensor]] moves faster than the threshold a [[component:signals#motion_sensor_block|motion]] event is queued. The sensor has a radius limit of 8 and is updated every half second. | + | 此组件由[[block:motion_sensor:zh|运动传感器]]提供。 |
+ | 若[[block:motion_sensor:zh|运动传感器]]视线范围内的某个实体移动速度超过阈值,将会有一个[[component:signals:zh#运动传感器方块|motion]]事件将被推入事件队列中。传感器的侦测范围半径为8,且每半秒钟更新一次数据。 | ||
- | Component name: `motion_sensor`. | + | 组件名:`motion_sensor`。 |
- | Callbacks: | + | |
+ | 回调函数: | ||
- `getSensitivity(): number` | - `getSensitivity(): number` | ||
- | Gets the current sensitivity of the sensor, i.e. at which speed threshold of distance / second it triggers. | + | 获取传感器当前的灵敏度,即实体移动速度达到多少格/秒时会触发信号。 |
+ | \\ | ||
- `setSensitivity(value: number): number` | - `setSensitivity(value: number): number` | ||
- | Sets the sensor's sensitivity to the specified value, returns the old value. | + | 将传感器的灵敏度设定为指定值,返回值为旧灵敏度。 |
目录 | 目录 | ||
---- | ---- | ||
{{page>component:contents:zh&noheader&noeditbutton&nouser&nofooter}} | {{page>component:contents:zh&noheader&noeditbutton&nouser&nofooter}} |