コード例 #1
0
        /// <summary>
        /// Changes the last shown text to the given text.
        /// </summary>
        public static void ChangeLastText(string text)
        {
            var data = DataHolder.TerminalData;

            if (data.Batching)
            {
                if (data.BatchEntries.Count == 0)
                {
                    ShowText(text);
                }
                else
                {
                    var entry = SList.Peek(data.BatchEntries);
                    DebugUtil.Assert(entry.Texts.Length > 1, "Changing last text as a single text but last text is not a single text!");
                    entry.Texts[0] = text;
                }
            }
            else
            {
                var allEntries = DataHolder.TerminalData.AllEntries;
                if (allEntries.Count == 0)
                {
                    ShowText(text);
                }
                else
                {
                    var lastEntry = SList.Peek(allEntries);
                    DebugUtil.Assert(lastEntry.EntryType != TerminalEntryType.SingleText, "Changing last text as a single text but last text is not a single text!");
                    var textEntry = lastEntry.SceneObject.GetComponent <SingleTextEntry>();
                    textEntry.TextComponent.text = text;
                }
            }
        }