LogoPixi’VN

历史记录

介绍Pixi'VN如何跟踪和管理历史记录,涵盖对话、选项、步骤计数及保存限制等内容。

UI screen

你可以在界面示例章节中找到历史记录UI界面的示例代码。

Pixi'VN 会保存游戏过程中每个步骤(step)中执行的所有对话、选择、回应等信息。

获取

叙事时间线(Narration Timeline)是一个包含了所有已展示给玩家的对话和选项的列表。
要获取历史记录,请使用stepHistory.narrativeHistory。 它会返回一个NarrativeHistory<T>[]类型的列表。

const dialogues: NarrativeHistory[] = stepHistory.narrativeHistory;

Remove

如果要删除所有历史记录,请使用stepHistory.removeNarrativeHistory()。

stepHistory.removeNarrativeHistory();

如果要删除部分历史记录,传入一个数字便可移除前N条记录:

// Delete the first 2 elements
stepHistory.removeNarrativeHistory(2);

其他叙事功能

On this page