private static void ReadDialogue(ref ReadData readData, bool commandAuto) { readData.SetData(Ins.m_currentData, Ins.CurrentDialogue); Ins.RefreshCommandTime(); if (commandAuto) { Ins.DoCurrentCommands(); } }
/// <summary> /// 读取剧本 /// </summary> /// <param name="scenario">剧本数据</param> /// <param name="readData">对话内容</param> /// <param name="commandAuto">自动执行指令</param> /// <param name="dialogueKey">初始对话键值</param> /// <returns>有可读的对话</returns> public static bool Read(ScenarioData scenario, ref ReadData readData, bool commandAuto = true, string dialogueKey = null) { Ins.ResetData(scenario); if (!string.IsNullOrEmpty(dialogueKey)) { int index = scenario.dialogues.FindIndex(x => x.key == dialogueKey); if (index < 0) { index = 0; Debug.LogWarning("没有对话与 Key: " + dialogueKey + " 对应"); } Ins.m_currentIndex = index; } if (Ins.CurrentDialogue != null) { ReadDialogue(ref readData, commandAuto); return(true); } return(false); }