docs(enemy): T15 并入 T13 审查遗留——AssignModules 改名 + InvalidateGraph
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -2551,6 +2551,25 @@ git commit -m "feat(enemy): EnemyAiBrain 支持配方资产/AiScript id 二选
|
|||||||
|
|
||||||
## Task 15: `EnemyAiRecipeWizard` 脚手架
|
## Task 15: `EnemyAiRecipeWizard` 脚手架
|
||||||
|
|
||||||
|
> **T13 审查遗留的两项,在本任务一并做**(当时推迟的理由:彼时只有测试调用,无活的隐患;
|
||||||
|
> 本任务的向导是第二个调用方,改名与缓存失效在此落地最自然):
|
||||||
|
>
|
||||||
|
> 1. **`PerceptionRecipeSO.SetModulesForTests` 改名为 `AssignModules`** —— 它不再只服务测试,
|
||||||
|
> 向导也要用它装配模块,原名误导。
|
||||||
|
> 2. **装配后必须让已缓存的图失效**。`AiRecipeSO` 持有 `_cached`(flyweight);若在
|
||||||
|
> `GetOrBuildGraph()` 之后改模块,改动不会生效直到下次 `PlayModeResetHook` 清理——
|
||||||
|
> 静默的陈旧图。为此在 `AiRecipeSO` 加:
|
||||||
|
> ```csharp
|
||||||
|
> /// <summary>装配 / 修改模块后调用,丢弃已缓存的图。</summary>
|
||||||
|
> protected void InvalidateGraph() => _cached = null;
|
||||||
|
> ```
|
||||||
|
> 并让 `AssignModules` 在末尾调它。
|
||||||
|
>
|
||||||
|
> 另一条 Minor(drawer 按简单类型名匹配,跨命名空间同名会静默选错)不在本次做:
|
||||||
|
> 当前 5 个模块名字唯一,不可达;若模块数增长到出现同名,再改成按 `FullName` 匹配。
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
CLAUDE.md 第 2 条:不裸建。配方资产必须由向导产出,保证路径、命名符合 `AssetFolderSpec`。
|
CLAUDE.md 第 2 条:不裸建。配方资产必须由向导产出,保证路径、命名符合 `AssetFolderSpec`。
|
||||||
|
|
||||||
**Files:**
|
**Files:**
|
||||||
|
|||||||
Reference in New Issue
Block a user