29 lines
960 B
C#
29 lines
960 B
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
|
|
/// <summary>
|
|
/// 存储对话信息的类。
|
|
/// </summary>
|
|
[System.Serializable]
|
|
public class DialogueEntry
|
|
{
|
|
public string role; // 角色名称
|
|
public List<string> dialogues; // 对话内容列表
|
|
public bool hasEvent; // 是否有事件触发
|
|
public string eventName; // 事件名称
|
|
public string eventRole; // 事件角色(如果有事件的话)
|
|
public List<string> eventChoices; // 事件选项(如果有事件的话)
|
|
public int nextEntryIndex; // 下一个对话条目索引
|
|
}
|
|
|
|
/// <summary>
|
|
/// 对话数据类,用于存储多个对话条目。
|
|
/// </summary>
|
|
[System.Serializable]
|
|
public class DialogueData
|
|
{
|
|
public List<DialogueEntry> entries; // 对话条目列表
|
|
public int currentEntryIndex; // 当前对话条目索引
|
|
public Dictionary<string,int> eventJumpTable = new Dictionary<string,int>(); // 事件跳转表
|
|
} |