Files
netease-modsdk-wiki/docs/mcguide/20-玩法开发/11-组装简单玩法/11-内置零件/00-触发器零件.md
2025-03-17 13:24:39 +08:00

27 lines
1.1 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
---
front: https://nie.res.netease.com/r/pic/20210727/76bfa7be-0be4-4e27-91a3-b5268695f359.png
hard: 入门
time: 20分钟
---
# 触发器
TriggerPart触发器零件包含一个长方体的区域可以使用触发器零件对进出区域的实体进行检测。
![image-20210710181419000](./images/parts001.png)
点击触发器,可以在他的属性面板中看到以下属性:
- 区域,用于指定触发器的区域
- 维度:用于指定这个区域在哪个维度
- 监听,影响触发器的事件发送
![image-20210710181656492](./images/parts002.png)
点击区域页签旁边的定位按钮,可以将触发器的区域显示出来(如下图),之后可以通过挪动坐标系整体移动区域的位置,或者使用鼠标对触发器区域的每一个面进行拖拽。
> 区域的坐标是相对于触发器的坐标,拖动触发器同样可以改变区域的整体位置。
![parts003](./images/parts003.gif)
>如果需要在游戏中使用脚本调用此零件,可以参考<a href="../../../../mcdocs/3-PresetAPI/预设对象/零件/触发器零件TriggerPart.html" rel="noopenner"> 触发器零件的API接口文档 </a>