> For the complete documentation index, see [llms.txt](https://docs.convai.com/api-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.convai.com/api-docs/zh/cha-jian-yu-ji-cheng/convai-unity-sdk/features/character-actions/actions-scripting-reference.md).

# 角色动作脚本参考

Convai 角色动作系统中所有公共类型的完整 API 参考。类型位于 `Convai.Runtime.Actions`, `Convai.Runtime.Components`, `Convai.Shared.Actions`，或 `Convai.Shared.Types` 命名空间中，除非另有说明。

### `ConvaiActionDispatcher`

`MonoBehaviour` — `Convai.Runtime.Actions`

菜单路径： `添加组件 → Convai → Convai Action Dispatcher`

约束： `DisallowMultipleComponent`, `RequireComponent(ConvaiCharacter)`

#### 属性

| 属性                 | 类型                                 | 描述                                               |
| ------------------ | ---------------------------------- | ------------------------------------------------ |
| `批处理策略`            | `ConvaiActionBatchPolicy`          | 当前批处理策略（代码只读；在 Inspector 中设置）                    |
| `失败策略`             | `ConvaiActionBatchFailurePolicy`   | 当前失败策略（代码只读；在 Inspector 中设置）                     |
| `OnBatchStarted`   | `UnityEvent`                       | 当批次开始执行时触发                                       |
| `OnStepStarted`    | `ConvaiActionInvocationUnityEvent` | 在每个动作步骤开始时触发                                     |
| `OnStepSucceeded`  | `ConvaiActionInvocationUnityEvent` | 当执行器返回时触发 `成功`                                   |
| `OnStepFailed`     | `ConvaiActionInvocationUnityEvent` | 当步骤失败时触发（Failed、Canceled 或 TimedOut）             |
| `OnStepUnhandled`  | `ConvaiActionInvocationUnityEvent` | 当执行器返回时触发 `未处理`                                  |
| `OnStepCompleted`  | `ConvaiActionStepReportUnityEvent` | 每个步骤完成后触发，无论成功与否，并携带完整的 `ConvaiActionStepReport` |
| `OnBatchCompleted` | `UnityEvent`                       | 当所有批次步骤完成且批次未被中止时触发                              |
| `OnBatchAborted`   | `UnityEvent`                       | 当……时触发 `StopBatch` 策略在失败后提前结束批次                  |

#### 方法

| 方法               | 签名                                                                | 描述                           |
| ---------------- | ----------------------------------------------------------------- | ---------------------------- |
| `EnqueueActions` | `void EnqueueActions(IReadOnlyList<ConvaiActionCommand> actions)` | 将一个批次提交给调度器。遵循当前启用的 `批处理策略`. |

### `ConvaiActionConfigSource`

`MonoBehaviour` — `Convai.Runtime.Components`

菜单路径： `添加组件 → Convai → Convai Action Config Source`

约束： `DisallowMultipleComponent`, `RequireComponent(ConvaiCharacter)`

#### 属性

| 属性                       | 类型                                               | 描述                     |
| ------------------------ | ------------------------------------------------ | ---------------------- |
| `定义`                     | `IReadOnlyList<ConvaiActionDefinition>`          | 作者定义的动作定义列表            |
| `对象`                     | `IReadOnlyList<ConvaiActionObjectDefinition>`    | 作者定义的可执行对象列表           |
| `角色`                     | `IReadOnlyList<ConvaiActionCharacterDefinition>` | 作者定义的可执行角色列表           |
| `InitialAttentionObject` | `string`                                         | 在连接时预先设为 NPC 注意焦点的对象名称 |

#### 方法

| 方法                  | 签名                                       | 描述                               |
| ------------------- | ---------------------------------------- | -------------------------------- |
| `BuildActionConfig` | `ConvaiActionConfig BuildActionConfig()` | 构建并返回连接时载荷。若返回 `null` 如果不存在有效定义。 |

### `ConvaiCharacter` — 与动作相关的成员

`MonoBehaviour` — `Convai.Runtime.Components`

#### 事件

| 事件                  | 类型                                                 | 描述                                   |
| ------------------- | -------------------------------------------------- | ------------------------------------ |
| `OnActionsReceived` | `event Action<IReadOnlyList<ConvaiActionCommand>>` | 当 Convai 为此角色返回一个动作批次时触发。在调度器处理之前触发。 |

#### 属性

| 属性     | 类型                   | 描述                             |
| ------ | -------------------- | ------------------------------ |
| `动作配置` | `ConvaiActionConfig` | 返回当前会话动作配置的克隆。可能在 `null` 连接之前。 |

#### 方法

| 方法                      | 签名                                                 | 描述                                                       |
| ----------------------- | -------------------------------------------------- | -------------------------------------------------------- |
| `GetActionConfigSource` | `ConvaiActionConfigSource GetActionConfigSource()` | 返回该 `ConvaiActionConfigSource` 此处 `GameObject`，或 `null`. |

{% hint style="info" %}
对当前注意对象的运行时更新由动态上下文系统处理，而不是由 `ConvaiCharacter` 直接处理。请参阅 [动态上下文脚本 API](/api-docs/zh/cha-jian-yu-ji-cheng/convai-unity-sdk/features/dynamic-context/dynamic-context-scripting-api.md).
{% endhint %}

### `RoomSessionConnectOptions` — 动作字段

`Convai.Runtime.Room`

| 字段       | 类型                             | 描述                                                                             |
| -------- | ------------------------------ | ------------------------------------------------------------------------------ |
| `动作配置覆盖` | `ConvaiActionConfig`           | 设置后，将替换 `ConvaiActionConfigSource.BuildActionConfig()` 在此会话中的结果。               |
| `动作定义覆盖` | `List<ConvaiActionDefinition>` | 设置后，将替换此会话在 Inspector 中的动作定义。会根据 `ActionConfigOverride.Actions` 进行过滤（如果两者都设置）。 |

### `ConvaiActionCommand`

`Convai.Shared.Types` — 可序列化密封类

后端返回的单个步骤的结构化动作命令。

#### 属性

| 属性                           | 类型                                               | 描述                                             |
| ---------------------------- | ------------------------------------------------ | ---------------------------------------------- |
| `名称`                         | `string`                                         | 必填。后端选择的动作名称（例如， `"Move To"`).                 |
| `目标`                         | `string`                                         | 可选。后端解析为目标的对象或角色名称。 `null` 如果没有目标。             |
| `动作字符串`                      | `string`                                         | 根据后端重建的原始动作字符串 `名称` 和 `目标`.                    |
| `参数`                         | `Dictionary<string, ConvaiActionParameterValue>` | 根据后端响应和当前 Unity 模板解析出的有类型参数。键不区分大小写。           |
| `WaitForBotSpeech`           | `bool`                                           | 新批次中的第一个动作在运行前是否应等待角色说话。                       |
| `DelayAfterBotSpeechSeconds` | `float`                                          | 在语音门控释放后应用的可选延迟。                               |
| `已丰富`                        | `bool`                                           | `true` 一旦命令已根据当前动作模板完成丰富。调度器会在分发前仅对未标记的命令丰富一次。 |
| `HasTarget`                  | `bool`                                           | `true` 当 `目标` 非空时。                             |

#### 构造函数

```csharp
new ConvaiActionCommand("Move To", "Crate")  // 名称 + 目标
new ConvaiActionCommand("Wave")              // 仅名称
```

构造函数会规范化 `名称` 和 `目标` 并推导 `动作字符串` 基于它们。 `参数`, `WaitForBotSpeech`, `DelayAfterBotSpeechSeconds`，以及 `已丰富` 默认值为空值，并由后端响应或丰富过程填充。

### `ConvaiActionParameterValue`

`Convai.Shared.Types` — 可序列化密封类

丰富后的一个有类型动作参数。每种表示都尽可能根据原始文本填充； `类型` 它指明作者模板意图使用哪一种。

#### 属性

| 属性       | 类型                               | 描述                                |
| -------- | -------------------------------- | --------------------------------- |
| `类型`     | `ConvaiActionParameterType`      | 强制转换后的有效类型。作者定义的 `Auto` 会解析为具体类型。 |
| `原始值`    | `string`                         | 解析此值时所依据的已去空格原始文本。                |
| `字符串值`   | `string`                         | 文本形式的值（与 `原始值` 去空格后相同）。           |
| `数值`     | `float`                          | 解析后的浮点数，或者 `0` 当文本不是数字时。          |
| `布尔值`    | `bool`                           | 解析后的布尔值，或者 `false` 当文本不是可识别的布尔值时。 |
| `已解析引用`  | `ConvaiActionParameterReference` | 当文本指名某个作者定义目标时，匹配到的目标； `null` 否则。 |
| `是否约束匹配` | `bool`                           | `false` 仅当 `选项` 参数文本不是其作者定义选项之一时。 |

通过以下方式读取参数： `ConvaiActionInvocation.TryGetParameter`, `GetString`, `GetNumber`, `GetBool`，或 `GetReference` 而不是直接索引 `ConvaiActionCommand.Parameters` 。

### `ConvaiActionParameterReference`

`Convai.Shared.Types` — 可序列化密封类

名称和类型处理一个 `引用` 在丰富过程中解析到的参数。

#### 属性

| 属性   | 类型                       | 描述                               |
| ---- | ------------------------ | -------------------------------- |
| `名称` | `string`                 | 原始值匹配到的作者定义目标名称（已去空格，绝不 `null`). |
| `种类` | `ConvaiActionTargetKind` | 名称是否匹配到作者定义的对象或角色。               |

`ConvaiActionParameterReference` 是一个查找键，不是场景绑定——它不携带 `GameObjectReference`。请通过以下方式将其解析为运行时 `GameObject` ： `ConvaiActionInvocation.GetReference(name)`，它会返回一个 `ConvaiResolvedActionTarget`.

### `ConvaiActionConfig`

`Convai.Shared.Actions` — 可序列化密封类

在连接时序列化到会话连接载荷中的动作可用项。

#### 属性

| 属性       | 类型                                      | 描述                                           |
| -------- | --------------------------------------- | -------------------------------------------- |
| `动作`     | `List<string>`                          | 此会话允许的动作名称。只发送名称——执行器绑定保留在本地。                |
| `对象`     | `List<ConvaiActionObjectDefinition>`    | 后端可能引用为目标的对象。 `GameObjectReference` 绝不会被序列化。 |
| `角色`     | `List<ConvaiActionCharacterDefinition>` | 后端可能引用为目标的角色。 `GameObjectReference` 绝不会被序列化。 |
| `当前注意对象` | `string`                                | 初始注意对象名称。必须与其中的一个条目匹配 `对象`.                  |

### `ConvaiActionConfigPatch`

`Convai.Shared.Actions` — 可序列化密封类

当前会话动作可用项的运行时补丁。

#### 属性

| 属性       | 类型                                      | 描述               |
| -------- | --------------------------------------- | ---------------- |
| `动作`     | `List<string>`                          | 替换动作列表。          |
| `角色`     | `List<ConvaiActionCharacterDefinition>` | 替换角色目标列表。        |
| `对象`     | `List<ConvaiActionObjectDefinition>`    | 替换对象目标列表。        |
| `当前注意对象` | `string`                                | 列表替换后解析出的注意对象更新。 |

{% hint style="warning" %}
每个字段遵循“省略”与“空值”语义： `null` 列表或字符串会保留当前值，而空列表或空字符串会显式清除该值。仅在确实要更改时设置字段。
{% endhint %}

### `ConvaiActionDefinition`

`Convai.Runtime.Actions` — 可序列化密封类

后端动作名称与执行器组件之间的本地 Unity 绑定。只有渲染后的线协议模板（来自 `ToActionConfigString`）会发送到后端。

#### 字段

| 字段                           | 类型                                      | 描述                                     |
| ---------------------------- | --------------------------------------- | -------------------------------------- |
| `ActionName`                 | `string`                                | 映射到此定义的动作名称。运行时匹配不区分大小写。               |
| `描述`                         | `string`                                | 发送给 Convai 用于语义对齐的可选描述。                |
| `参数`                         | `List<ConvaiActionParameterDefinition>` | 按顺序排列的有类型参数，会渲染到线协议模板中。                |
| `目标要求`                       | `ConvaiActionTargetRequirement`         | 此动作需要哪种类型的目标。                          |
| `执行器`                        | `MonoBehaviour`                         | 执行该行为的组件。必须实现 `IConvaiActionExecutor`. |
| `超时时间（秒）`                    | `float`                                 | 最大执行时间（秒）。 `0` = 无超时。                  |
| `失败策略覆盖`                     | `ConvaiActionFailurePolicyOverride`     | 针对单个动作覆盖调度器的批失败策略。                     |
| `WaitForBotSpeech`           | `bool`                                  | 新批次的第一步是否等待角色说话。                       |
| `DelayAfterBotSpeechSeconds` | `float`                                 | 语音门控释放后的可选延迟。                          |

#### 方法

| 方法                     | 签名                              | 描述                            |
| ---------------------- | ------------------------------- | ----------------------------- |
| `ToActionConfigString` | `string ToActionConfigString()` | 将发送给 Convai 的该定义线协议模板字符串渲染出来。 |

### `ConvaiActionParameterDefinition`

`Convai.Runtime.Actions` — 可序列化密封类

单个有类型动作参数的作者定义，由 `ConvaiActionDefinition.Parameters`.

#### 字段

| 字段    | 类型                          | 描述                                       |
| ----- | --------------------------- | ---------------------------------------- |
| `名称`  | `string`                    | 用于作为线协议键和模板锚点的参数名称。                      |
| `描述`  | `string`                    | 发送给 Convai 用于语义对齐的可选描述。                  |
| `类型`  | `ConvaiActionParameterType` | 声明的参数类型。 `Auto` 从值推断。默认 `Auto`.          |
| `连接词` | `string`                    | 在线协议模板中渲染在参数前的可选连接词（例如 `"on"` 或 `"in"`). |
| `选项`  | `List<string>`              | 允许的值，当 `类型` 是 `选项`.                      |

### `ConvaiActionObjectDefinition`

`Convai.Shared.Actions` — 可序列化密封类

#### 属性

| 属性                    | 类型           | 已序列化                   | 描述                        |
| --------------------- | ------------ | ---------------------- | ------------------------- |
| `名称`                  | `string`     | 是（`"name"`)            | 用于动作命令中的标识符。匹配不区分大小写。     |
| `描述`                  | `string`     | 是（`"description"`)     | 发送给 Convai 以供引用解析的自然语言描述。 |
| `GameObjectReference` | `GameObject` | **未** (`[JsonIgnore]`) | 本地场景引用。绝不会发送给 Convai。     |

### `ConvaiActionCharacterDefinition`

`Convai.Shared.Actions` — 可序列化密封类

#### 属性

| 属性                    | 类型           | 已序列化                   | 描述                             |
| --------------------- | ------------ | ---------------------- | ------------------------------ |
| `名称`                  | `string`     | 是（`"name"`)            | 此角色目标的标识符。                     |
| `简介`                  | `string`     | 是（`"bio"`)             | 发送给 Convai 的简短描述（例如，“工地安全主管”）。 |
| `GameObjectReference` | `GameObject` | **未** (`[JsonIgnore]`) | 本地场景引用。绝不会发送给 Convai。          |

### `ConvaiActionInvocation`

`Convai.Runtime.Actions` — 密封类

传递给执行器和所有调度器事件的有类型执行上下文。

#### 属性

| 属性      | 类型                           | 描述                                 |
| ------- | ---------------------------- | ---------------------------------- |
| `命令`    | `ConvaiActionCommand`        | 此步骤的后端原始命令。                        |
| `定义`    | `ConvaiActionDefinition`     | 匹配到的本地动作定义。 `null` 如果未找到定义（步骤将失败）。 |
| `已解析目标` | `ConvaiResolvedActionTarget` | 已解析的目标绑定。 `null` 如果该动作没有目标或解析失败。   |
| `角色`    | `ConvaiCharacter`            | 执行此动作的 NPC。                        |
| `批次索引`  | `int`                        | 在调度器生命周期内，该批次的顺序索引。                |
| `步骤索引`  | `int`                        | 当前批次中此步骤的从 0 开始索引。                 |

#### 方法

| 方法                | 签名                                                                        | 描述                                      |
| ----------------- | ------------------------------------------------------------------------- | --------------------------------------- |
| `TryGetParameter` | `bool TryGetParameter(string name, out ConvaiActionParameterValue value)` | 尝试按名称读取一个有类型参数（不区分大小写）。                 |
| `GetString`       | `string GetString(string name, string fallback = "")`                     | 读取字符串参数，并在缺失时返回 `fallback` 。            |
| `GetNumber`       | `float GetNumber(string name, float fallback = 0f)`                       | 读取数值参数，并在缺失时返回 `fallback` 。             |
| `GetBool`         | `bool GetBool(string name, bool fallback = false)`                        | 读取布尔参数，并在缺失时返回 `fallback` 。             |
| `GetReference`    | `ConvaiResolvedActionTarget GetReference(string name)`                    | 根据角色的动作配置解析引用参数；当参数未携带显式类型时，回退到定义的目标要求。 |

### `ConvaiResolvedActionTarget`

`Convai.Runtime.Actions` — 可序列化密封类

单个动作步骤的已解析目标。

#### 属性

| 属性                    | 类型                                | 描述                                       |
| --------------------- | --------------------------------- | ---------------------------------------- |
| `种类`                  | `ConvaiActionTargetKind`          | 已解析目标是对象、角色还是无。                          |
| `名称`                  | `string`                          | 解析后的名称（来自后端命令）。                          |
| `对象绑定`                | `ConvaiActionObjectDefinition`    | 匹配到的对象定义。 `null` 如果 `Kind != Object`.    |
| `角色绑定`                | `ConvaiActionCharacterDefinition` | 匹配到的角色定义。 `null` 如果 `Kind != Character`. |
| `GameObjectReference` | `GameObject`                      | 场景 `GameObject` 来自匹配绑定中的场景引用。执行器中的主要访问点。 |

### `ConvaiActionExecutionResult`

`Convai.Runtime.Actions` — 只读结构体

返回类型，用于 `IConvaiActionExecutor.ExecuteAsync`.

#### 属性

| 属性   | 类型                            | 描述                       |
| ---- | ----------------------------- | ------------------------ |
| `状态` | `ConvaiActionExecutionStatus` | 此执行步骤的结果。                |
| `消息` | `string`                      | 可选的人类可读详情。在事件处理程序和日志中可用。 |
| `异常` | `异常`                          | 导致失败的异常（如果有）。            |

#### 工厂方法

| 方法    | 签名                                                                                             | 适用于                                          |
| ----- | ---------------------------------------------------------------------------------------------- | -------------------------------------------- |
| `成功`  | `static ConvaiActionExecutionResult Succeeded(string message = null)`                          | 行为已成功完成。                                     |
| `失败`  | `static ConvaiActionExecutionResult Failed(string message = null, Exception exception = null)` | 发生了真实错误。                                     |
| `已取消` | `static ConvaiActionExecutionResult Canceled()`                                                | 该 `CancellationToken` 已被发出信号。                |
| `超时`  | `static ConvaiActionExecutionResult TimedOut()`                                                | **不要手动调用。** 当……时，调度器会自动返回此结果 `超时时间（秒）` 超时失效。 |
| `未处理` | `static ConvaiActionExecutionResult Unhandled(string message = null)`                          | 此执行器有意拒绝该调用。                                 |

### `ConvaiActionStepReport`

`Convai.Runtime.Actions` — 可序列化密封类

已完成步骤报告发出于 `ConvaiActionDispatcher.OnStepCompleted`.

#### 属性

| 属性      | 类型                            | 描述                 |
| ------- | ----------------------------- | ------------------ |
| `调用`    | `ConvaiActionInvocation`      | 报告所描述的调用。          |
| `结果`    | `ConvaiActionExecutionResult` | 该步骤的原始执行器结果。       |
| `批次已中止` | `bool`                        | 此步骤是否中止了剩余批次。      |
| `消息`    | `string`                      | 成功详情，或非成功状态下的失败消息。 |
| `失败消息`  | `string`                      | 包括批次后果的失败详情。成功时为空。 |

### `IConvaiActionExecutor`

`Convai.Runtime.Actions` — 接口

所有动作行为的扩展点。可在任何上实现 `MonoBehaviour`.

```csharp
public interface IConvaiActionExecutor
{
    Task<ConvaiActionExecutionResult> ExecuteAsync(
        ConvaiActionInvocation invocation,
        CancellationToken cancellationToken);
}
```

返回 `ConvaiActionExecutionResult.Unhandled` 当组件无法处理该调用时（例如缺少 rig 或 peer），这样分发器就可以将其明确报告。遵守 `cancellationToken` 用于批次替换和超时。

### 枚举

动作系统的枚举，按此分组以供参考——上面的一个或多个类型都会使用它们。

#### `ConvaiActionBatchPolicy`

`Convai.Runtime.Actions`

| 值       | 整数  | 描述                      |
| ------- | --- | ----------------------- |
| `队列`    | `0` | 新批次会等待当前批次完成。默认。        |
| `替换当前项` | `1` | 取消当前步骤和所有待处理批次；立即开始新批次。 |
| `丢弃传入项` | `2` | 丢弃新批次，直到所有当前和排队的工作完成。   |

#### `ConvaiActionBatchFailurePolicy`

`Convai.Runtime.Actions`

| 值           | 整数  | 描述                                     |
| ----------- | --- | -------------------------------------- |
| `StopBatch` | `0` | 失败的步骤会中止剩余批次。 `OnBatchAborted` 触发。默认。  |
| `继续批次`      | `1` | 执行无论如何都会继续到下一步。 `OnBatchCompleted` 触发。 |

#### `ConvaiActionTargetRequirement`

`Convai.Runtime.Actions`

| 值    | 整数  | 描述              |
| ---- | --- | --------------- |
| `无`  | `0` | 动作不需要目标。        |
| `对象` | `1` | 动作需要一个已解析的对象目标。 |
| `角色` | `2` | 动作需要一个已解析的角色目标。 |
| `任一` | `3` | 动作接受对象或角色作为目标。  |

#### `ConvaiActionFailurePolicyOverride`

`Convai.Runtime.Actions`

| 值           | 整数  | 描述                                   |
| ----------- | --- | ------------------------------------ |
| `使用分发器默认值`  | `0` | 遵循 `ConvaiActionDispatcher` 失败策略。默认。 |
| `StopBatch` | `1` | 非成功结果会中止剩余批次。                        |
| `继续批次`      | `2` | 非成功结果会让剩余批次继续。                       |

#### `ConvaiActionTargetKind`

`Convai.Shared.Types`

| 值    | 整数  | 描述        |
| ---- | --- | --------- |
| `无`  | `0` | 未解析到目标。   |
| `对象` | `1` | 目标是已注册对象。 |
| `角色` | `2` | 目标是已注册角色。 |

#### `ConvaiActionParameterType`

`Convai.Shared.Types`

| 值      | 整数  | 描述                                   |
| ------ | --- | ------------------------------------ |
| `Auto` | `0` | 尽力按此顺序推断引用、数字、布尔值或字符串。默认。            |
| `引用`   | `1` | 按名称解析已创建的对象或角色目标。                    |
| `字符串`  | `2` | 保留原始文本。                              |
| `数字`   | `3` | 解析不受区域设置影响的浮点数。                      |
| `布尔值`  | `4` | 解析 `true`/`是`/`1` 或 `false`/`否`/`0`. |
| `选项`   | `5` | 需要使用已创建的选项字符串之一。不匹配会通过标记该值 `是否约束匹配`. |

#### `ConvaiActionExecutionStatus`

`Convai.Runtime.Actions`

| 值     | 整数  | 分发器事件触发           |
| ----- | --- | ----------------- |
| `成功`  | `0` | `OnStepSucceeded` |
| `失败`  | `1` | `OnStepFailed`    |
| `已取消` | `2` | `OnStepFailed`    |
| `超时`  | `3` | `OnStepFailed`    |
| `未处理` | `4` | `OnStepUnhandled` |

### `ConvaiActionInvocationUnityEvent`

`Convai.Runtime.Actions` — 可序列化类，继承自 `UnityEvent<ConvaiActionInvocation>`

使……成为可序列化的包装类型 `ConvaiActionInvocation` 可作为 UnityEvent 参数进行序列化。像标准 UnityEvent 一样在 Inspector 中分配处理程序。该事件的唯一参数是 `ConvaiActionInvocation` 该步骤的

`ConvaiActionStepReportUnityEvent` 是……对应的等效包装器 `ConvaiActionDispatcher.OnStepCompleted`；它扩展了 `UnityEvent<ConvaiActionStepReport>` 并携带完整的 `ConvaiActionStepReport` 而不是。

### `ConvaiActionDebugProbe`

`MonoBehaviour` — `Convai.Runtime.Actions`

菜单路径： `添加组件 → Convai → Debug → Convai Action Debug Probe`

约束： `DisallowMultipleComponent`, `RequireComponent(ConvaiCharacter)`

参见 [排查角色动作问题](/api-docs/zh/cha-jian-yu-ji-cheng/convai-unity-sdk/features/character-actions/debugging-and-troubleshooting.md) 以获取完整的 Inspector 字段参考和使用指南。

#### 上下文菜单操作

| 命令       | 效果                                               |
| -------- | ------------------------------------------------ |
| `注入测试批次` | 提交一个 `移动到` 目标为第一个已注册对象的命令发送到分发器。在没有实时对话的情况下测试管线。 |
| `重置探针状态` | 将所有计数器和文本字段重置为零/空。                               |

### 下一步

{% content-ref url="/pages/0e9ccbf7f8fa10ad65f6395315d82ba64412791c" %}
[角色动作示例](/api-docs/zh/cha-jian-yu-ji-cheng/convai-unity-sdk/features/character-actions/usage-examples.md)
{% endcontent-ref %}

{% content-ref url="/pages/1398e3302b345ef93934a0e6c93b4d8e576ab00e" %}
[排查角色动作问题](/api-docs/zh/cha-jian-yu-ji-cheng/convai-unity-sdk/features/character-actions/debugging-and-troubleshooting.md)
{% endcontent-ref %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.convai.com/api-docs/zh/cha-jian-yu-ji-cheng/convai-unity-sdk/features/character-actions/actions-scripting-reference.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
