> For the complete documentation index, see [llms.txt](https://octanta-studio.gitbook.io/zi-dong-jiao-cheng-sheng-cheng-qi-you-xi-nei-ti-shi-cn/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://octanta-studio.gitbook.io/zi-dong-jiao-cheng-sheng-cheng-qi-you-xi-nei-ti-shi-cn/data/supported-input.md).

# Supported Input

{% hint style="info" %}
为了通用使用，设置Interaction → Manually Call和Step Start → Manually Call。现在您可以使用脚本的手动调用将步骤绑定到您自己实现的任何类型的输入。参见 [Manual Calls](/zi-dong-jiao-cheng-sheng-cheng-qi-you-xi-nei-ti-shi-cn/usage-guide/advanced-manual-step-calls.md)。
{% endhint %}

为不同类型的目标提供输入：3D/2D/UI或Any Target（任何地方）。目前支持以下交互和输入类型：

<table><thead><tr><th width="197">Input</th><th width="215">Description</th><th width="129">Platform Support</th><th>Generated default visual</th></tr></thead><tbody><tr><td>Manually Call</td><td>Called from a script or by a button (see <a href="/pages/PuZYSy2gXp568YoztFQD">Manual Step Calls</a>)</td><td>Any platform</td><td>Set manually</td></tr><tr><td>Click</td><td>Left mouse click or touch</td><td>PC &#x26; Mobile</td><td>UI Pointer + UI Hover + UI Graphic Text</td></tr><tr><td>RightClick</td><td>Right mouse button click</td><td>PC Only</td><td>UI Pointer Mouse + UI Hover</td></tr><tr><td>DoubleClick</td><td>Double left mouse click or double tap</td><td>PC &#x26; Mobile</td><td>UI Pointer Mouse + UI Hover</td></tr><tr><td>DoubleRightClick</td><td>Double right mouse click</td><td>PC Only</td><td>UI Pointer Mouse + UI Hover</td></tr><tr><td>Hold</td><td>Long press of the left mouse button or hold</td><td>PC &#x26; Mobile</td><td>UI Pointer Mouse + UI Hover</td></tr><tr><td>RightHold</td><td>Long press of the right mouse button</td><td>PC Only</td><td>UI Pointer Mouse + UI Hover</td></tr><tr><td>Drag</td><td>Long press of the left mouse button or hold with object movement</td><td>PC &#x26; Mobile</td><td>UI Pointer Mouse + UI Hover</td></tr><tr><td>RightDrag</td><td>Long press of the right mouse button with object movement</td><td>PC Only</td><td>UI Pointer Mouse + UI Hover</td></tr><tr><td>DragAndDrop*</td><td>Drag and drop element</td><td>PC &#x26; Mobile</td><td>UI Pointer + UI Hover + UI Graphic Text</td></tr><tr><td>RightDragAndDrop</td><td>Drag and drop element via right mouse button</td><td>PC Only</td><td>UI Pointer + UI Hover + UI Graphic Text</td></tr><tr><td>ScrollUp</td><td>Scroll up using mouse wheel</td><td>PC Only</td><td>UI Graphic Text</td></tr><tr><td>ScrollDown</td><td>Scroll down using mouse wheel</td><td>PC Only</td><td>UI Graphic Text</td></tr><tr><td>MouseHover</td><td>Waits for the mouse to hover over the object</td><td>PC Only</td><td>Set manually</td></tr><tr><td>ScreenCenterHover</td><td>Waits for the object to be aimed at by the center of the screen</td><td>PC &#x26; Mobile</td><td>Set manually</td></tr><tr><td>KeyCode</td><td>Pressing a keyboard key</td><td>PC Only</td><td>UI Graphic Text</td></tr><tr><td>KeyCodeHold</td><td>Holding a keyboard key</td><td>PC Only</td><td>UI Graphic Text</td></tr><tr><td>SwipeUp</td><td>Swipe up with a mouse or touch</td><td>PC &#x26; Mobile</td><td>UI Graphic Swipe Circle</td></tr><tr><td>SwipeDown</td><td>Swipe down with a mouse or touch</td><td>PC &#x26; Mobile</td><td>UI Graphic Swipe Circle</td></tr><tr><td>SwipeLeft</td><td>Swipe left with a mouse or touch</td><td>PC &#x26; Mobile</td><td>UI Graphic Swipe Circle</td></tr><tr><td>SwipeRight</td><td>Swipe right with a mouse or touch</td><td>PC &#x26; Mobile</td><td>UI Graphic Swipe Circle</td></tr><tr><td>Middle Click</td><td>Middle mouse button click</td><td>PC Only</td><td>UI Pointer Mouse + UI Hover</td></tr><tr><td>Middle Hold</td><td>Middle mouse button hold</td><td>PC Only</td><td>UI Pointer Mouse + UI Hover</td></tr><tr><td>Pinch In</td><td>Pinch in gesture for zooming out</td><td>Mobile Only</td><td>UI Graphic Text</td></tr><tr><td>Pinch Out</td><td>Pinch out gesture for zooming in</td><td>Mobile Only</td><td>UI Graphic Text</td></tr><tr><td>Pinch Rotate</td><td>Gesture for rotating</td><td>Mobile Only</td><td>UI Graphic Text</td></tr></tbody></table>

* 对于Drag and Drop交互，可能有两种情况：

| Project logic                             | In recording                                         | In playback                               |
| ----------------------------------------- | ---------------------------------------------------- | ----------------------------------------- |
| 如果在移动过程中，被持有的对象对射线检测变为非阻挡状态，并且可以识别其后面的对象。 | 初始对象和最终对象都被识别。该交互被视为DragAndDrop。                     | 玩家需要将一个对象拖拽到另一个对象上。                       |
| 如果在移动过程中，被持有的对象对射线检测不变为透明状态，并且无法识别其后面的对象。 | 只识别初始对象 - 即它被移动和释放。该交互被视为Drag；但是，可以手动设置为Drag & Drop。 | 玩家需要将一个对象拖拽到任何地方并释放它（拖拽在移动阶段就已执行，甚至无需释放）。 |

## Check Object

检查对象验证可以通过以下方式执行：

* **Check Object = By Tag.** 将比较标签指定为字符串。这样上面选择的触发器将仅对具有该标签的对象激活。
* **Check Object = By Layer.** 将比较层级指定为整数索引。这样上面选择的触发器将仅对具有该层级的对象激活。
* **Check Object = By Type.** 指定比较类型：3D/2D/UI。这样上面选择的触发器将仅对具有该类型的对象激活。
* **Check Object = By Name.** 指定比较名称。这样上面选择的触发器将仅对名称包含该部分的对象激活。
* **Check Object = By Component.** 指定比较组件：从项目中创建的自定义组件列表中选择（非内置组件，而是用户定义的组件）。这样上面选择的触发器将仅对具有该组件的对象激活。

{% columns %}
{% column width="50%" %}

* **Check Object = By ComponentValue.** 指定比较组件及其值以与目标值进行比较。这样触发器将仅对具有该组件和所需值的对象激活。可以从项目中手动创建的脚本中进行选择.\
  \
  **支持的变量类型：**&#x42;ool、Int、Float、String、Enum\
  \
  **可用的比较运算符：**&#x7B49;于 (==)、不等于 (!=)、大于 (>)、小于 (<)、大于或等于 (>=)、小于或等于 (<=)、包含 (string.Contains)、开头为 (string.StartsWith)、结尾为 (string.EndsWith)。
  {% endcolumn %}

{% column width="50%" %}

<figure><img src="/files/axwN12dGFX8W0sdi4UFC" alt=""><figcaption></figcaption></figure>

<sub>*Configuration that triggers the visual only when hovering over objects with IsHexAvailable = true in the ValueHandler component on the object.*</sub>
{% endcolumn %}
{% endcolumns %}

## Old and New Input System

When the TutorialSystem prefab is added to the scene, the Input Controller automatically adjusts to match the Input System in the project, edits or removes the child backup EventSystem if it already exists in the scene. However, manual correction may still be required.

默认情况下，系统设置为旧版Input Manager。要完全切换到新版，请按以下步骤操作：

* 打开Edit → Project Settings → Player → Configuration，如果尚未选择，将Active Input Handling设置为New。
* 如果尚未安装，请安装Input System Unity包。
* 如果尚未使用，将EventSystem设置为InputSystemUIInputModule。
* 在InputController组件中将inputSystemType设置为New。

<figure><img src="/files/jX3iV6OnJ2PT27seu7Ui" alt=""><figcaption></figcaption></figure>
