对话树系统开发指南
1. 话题处理与回复显示
在开发对话系统时,首先要处理话题列表,避免出现空白项。若当前话题字符串未激活,需调整话题列表编号。代码如下:
else i--; // else it wasn't active, so adjust the topic list number so you don't have a blank spot
j++; // increment the topics element number
处理完话题后,要显示对应的回复。具体操作步骤如下:
1. 在 topics_1 数组下创建新数组 replies_1 ,包含六个元素:
// replies_1 character reply text
internal var replies_1 = new String[6];
- 填充
replies_1数组元素:
replies_1[0] = "You shouldn't see this";
replies_1[1] = "I've been expecting you";
replies_1[2] = "You are in the Maze";
replies_1[3] = "No idea, I've been stuck here for ages";
replies_1[4] = "You were transported here";
repl
对话树系统开发全解析
超级会员免费看
订阅专栏 解锁全文
1272

被折叠的 条评论
为什么被折叠?



