- 新增Archive相关资源和预制体 - 新增SalesSystem销售系统基础 - 添加火山美术资源文件夹 Co-Authored-By: Claude Code <noreply@anthropic.com>
224 lines
4.9 KiB
Plaintext
224 lines
4.9 KiB
Plaintext
# 分析模式设置指南
|
|
|
|
## 一、创建关卡配置
|
|
|
|
### 1. 创建 ScriptableObject
|
|
|
|
1. 在 Project 窗口中,找到 `Assets/Resources/AnalysisLevels/` 文件夹(如果没有请创建)
|
|
2. 右键 → `Create > AIBIS > Language > Analysis Level`
|
|
3. 命名为 `AnalysisLevel_Fear_01`
|
|
|
|
### 2. 配置关卡数据
|
|
|
|
在 Inspector 中填写:
|
|
|
|
**关卡基础信息:**
|
|
- Level Name: "恐惧关卡1"
|
|
- Description: "找出隐藏在笑话中的焦虑"
|
|
|
|
**解码器配置:**
|
|
- Decoder Width: 5
|
|
- Decoder Height: 3
|
|
- Hole Positions: (点击 + 添加3个位置)
|
|
- Element 0: X=0, Y=0
|
|
- Element 1: X=1, Y=1
|
|
- Element 2: X=2, Y=4
|
|
|
|
**答案配置:**
|
|
- Answer Emotion: Fear
|
|
- Answer Words: (点击 + 添加3个词)
|
|
- Element 0: "临检"
|
|
- Element 1: "英里"
|
|
- Element 2: "担心"
|
|
- Correct Decoder Position: X=3, Y=5
|
|
- Complete Sentence: "[临检]要来了,不合格[英里]被骂了,这让我很[担心]"
|
|
|
|
**词池配置:**
|
|
展开 Word Pool,确保:
|
|
- Fear Words 列表中包含 "临检", "英里", "担心"
|
|
- 每种情绪至少有 15 个词
|
|
|
|
**难度配置:**
|
|
- Decoy Count Per Emotion: 15
|
|
- Frequency Tolerance: 8.0
|
|
|
|
**完成回调:**
|
|
- Success Node Name: "Analysis_Fear_01_Success"
|
|
- Fail Node Name: "Analysis_Fear_01_Fail"
|
|
|
|
---
|
|
|
|
## 二、设置 AnalysisModeManager
|
|
|
|
### 1. 在场景中找到或创建 AnalysisModeManager
|
|
|
|
1. 在 Hierarchy 中找到包含 `AnalysisModeManager` 的物体
|
|
2. 如果没有,创建一个空物体,添加 `AnalysisModeManager` 组件
|
|
|
|
### 2. 配置 Inspector
|
|
|
|
**Canvas 引用:**
|
|
- Shared Canvas: 拖入共享的 Canvas(与 LanguageParticleManager 使用同一个)
|
|
|
|
**UI 引用:**
|
|
- Analysis Panel: 分析面板 RectTransform
|
|
- Initialize Button: "初始化" 按钮
|
|
- Emotion Slider: 情绪频率滑动条
|
|
- Frequency Text: 频率显示文本
|
|
- Signal Strength Text: 信号强度文本
|
|
- Start Filter Button: "启动过滤" 按钮
|
|
- Verify Button: "验证" 按钮
|
|
|
|
**网格配置:**
|
|
- Grid Container: 可选
|
|
- Grid Width: 20
|
|
- Grid Height: 20
|
|
- Cell Size: 0.4
|
|
- Cell Gap: 0.05
|
|
- Cell Font Size: 2.5
|
|
- Grid Center Offset: (0, 0, 0)
|
|
|
|
**解码器条纹:**
|
|
- Decoder Strip: 拖入解码器条纹 Prefab
|
|
|
|
**字体配置:**
|
|
- Chinese Font Asset: 拖入中文字体
|
|
|
|
**关卡配置:**
|
|
- Current Level Data: 拖入刚创建的 `AnalysisLevel_Fear_01`
|
|
|
|
---
|
|
|
|
## 三、创建解码器条纹 Prefab
|
|
|
|
### 1. 创建 UI 对象
|
|
|
|
1. 在 Canvas 下创建空物体
|
|
2. 命名为 "DecoderStrip"
|
|
3. 添加组件:
|
|
- RectTransform (自动添加)
|
|
- Image
|
|
- Canvas Group
|
|
- AnalysisDecoderStrip
|
|
|
|
### 2. 配置组件
|
|
|
|
**RectTransform:**
|
|
- Anchor: Center
|
|
- Pivot: (0.5, 0.5)
|
|
- Size Delta: 会被代码动态设置
|
|
|
|
**Image:**
|
|
- Color: R=0, G=30, B=30, A=242 (半透明深青色)
|
|
|
|
**AnalysisDecoderStrip:**
|
|
- Is Draggable: ✓
|
|
- Drag Alpha: 0.7
|
|
- Strip Color: (0, 0.12, 0.12, 0.95)
|
|
- Border Color: Cyan
|
|
- Border Width: 2
|
|
|
|
### 3. 添加孔洞标记(可选)
|
|
|
|
在 DecoderStrip 下创建子物体标记孔洞位置:
|
|
|
|
1. 创建3个 Image 子物体,命名为 "Hole_1", "Hole_2", "Hole_3"
|
|
2. 设置为小圆圈或方框
|
|
3. 位置对应配置中的 holePositions
|
|
|
|
### 4. 保存为 Prefab
|
|
|
|
将 DecoderStrip 拖到 Project 窗口,保存为 Prefab
|
|
|
|
---
|
|
|
|
## 四、在 Yarn 脚本中使用
|
|
|
|
创建或编辑 .yarn 文件:
|
|
|
|
```yarn
|
|
title: TestAnalysisMode
|
|
---
|
|
艾比斯: 让我看看这些记忆背后藏着什么...
|
|
|
|
<<start_analysis level:AnalysisLevel_Fear_01>>
|
|
|
|
// 玩家进行分析游戏,成功后自动跳转到下一个节点
|
|
|
|
===
|
|
|
|
title: Analysis_Fear_01_Success
|
|
---
|
|
艾比斯: 我明白了...这些笑话背后藏着焦虑...
|
|
艾比斯: [临检]要来了,不合格[英里]被骂了,这让我很[担心]...
|
|
-> 继续
|
|
<<close_analysis>>
|
|
===
|
|
|
|
title: Analysis_Fear_01_Fail
|
|
---
|
|
艾比斯: 似乎不对...让我再试试...
|
|
===
|
|
```
|
|
|
|
---
|
|
|
|
## 五、测试
|
|
|
|
1. 运行场景
|
|
2. 触发包含 `start_analysis` 命令的对话
|
|
3. 观察分析模式是否正确启动
|
|
4. 调整频率滑动条,拖动解码器条纹
|
|
5. 点击验证按钮测试
|
|
|
|
---
|
|
|
|
## 六、调试
|
|
|
|
### 查看日志
|
|
|
|
生成器会输出详细日志:
|
|
|
|
```
|
|
[AnalysisModeGenerator] 验证通过:唯一解
|
|
[AnalysisModeManager] 已加载关卡: 恐惧关卡1
|
|
```
|
|
|
|
### 常见问题
|
|
|
|
**Q: 提示"找不到关卡配置"**
|
|
A: 确保配置文件在 `Assets/Resources/AnalysisLevels/` 目录下
|
|
|
|
**Q: 提示"类型找不到"**
|
|
A: 在 Unity 中等待编译完成,或重启 Unity
|
|
|
|
**Q: 网格没有生成**
|
|
A: 检查 Console 是否有错误日志,确认配置数据有效
|
|
|
|
**Q: 解码器条纹不能拖动**
|
|
A: 检查 Canvas 的 Raycast Target 设置,确保 EventSystem 存在
|
|
|
|
---
|
|
|
|
## 七、进阶配置
|
|
|
|
### 创建更多关卡
|
|
|
|
复制 `AnalysisLevel_Fear_01`,修改:
|
|
- 答案词
|
|
- 孔洞位置
|
|
- 解码器正确位置
|
|
- 诱饵词数量
|
|
|
|
### 增加难度
|
|
|
|
- 增加 `decoyCountPerEmotion` (诱饵词数量)
|
|
- 减小 `frequencyTolerance` (频率容差)
|
|
- 增加网格尺寸
|
|
- 使用更多孔洞
|
|
|
|
---
|
|
|
|
完成!现在可以创建和配置分析模式关卡了。
|
|
|