用途:为 Decentraland 场景实体添加点击、悬停、指针事件、触发区域、射线检测和全局输入。
主要能力:pointerEventsSystem.onPointerDown/onPointerUp 注册点击与释放回调,支持 hoverText、maxDistance 和 InputAction(IA_POINTER、IA_PRIMARY 等);onProximityDown/Enter/Leave 按玩家距离触发,无需碰撞体;TriggerArea 配合 triggerAreaEventsSystem 检测进入、离开、停留;raycastSystem 支持局部方向、全局方向、全局目标、目标实体四种射线模式,也可用 Raycast 组件;inputSystem 轮询按键,PointerLock 与 PrimaryPointerInfo 读取光标状态。
使用方式:可点击实体在 main-entities.ts 中只声明 Transform/Mesh/Material,交互逻辑在 src/index.ts 运行时通过 helper 注册,不要重复声明 PointerEvents。指针事件要求实体在 CL_POINTER 层有碰撞体,可用 MeshCollider.setBox 或设置 GLTF 的 visibleMeshesCollisionMask。
限制:资料未提供收费、价格与平台信息;移动端无键盘,应依赖指针与屏幕按钮;射线建议 continuous 设为 false,除非需要逐帧结果。