diff --git a/.gitignore b/.gitignore index 29742cc..eb6e5d3 100644 --- a/.gitignore +++ b/.gitignore @@ -84,4 +84,12 @@ crashlytics-build.properties /Assets/RawResources -/.vscode \ No newline at end of file +/.vscode + +# Excel temporary lock files +~$*.xls +~$*.xlsx +~$*.xlsm +~$*.xlsb + +/数据表/__pycache__ \ No newline at end of file diff --git a/Assets/GameMain/DataTables/Dialog.txt b/Assets/GameMain/DataTables/Dialog.txt new file mode 100644 index 0000000..bb0b92c --- /dev/null +++ b/Assets/GameMain/DataTables/Dialog.txt @@ -0,0 +1,7 @@ +# 对话标识表 筛选用数据 +# Id Title UIMode ChapterId +# int string DialogUIMode int +# 对话编号 策划备注 对话标识 对话形式 章节编号 + 1001 第一章介绍 Chapter1_Intro Mask 1.001 + 1002 第一章主流程 Chapter1_Main BottomBox 1.002 + 1003 第一章玩法开始前闲聊 Chapter1_SmallTalk1 Bubble 1.003 diff --git a/Assets/GameMain/DataTables/Dialog.txt.meta b/Assets/GameMain/DataTables/Dialog.txt.meta new file mode 100644 index 0000000..435ba4a --- /dev/null +++ b/Assets/GameMain/DataTables/Dialog.txt.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 788b17ff3aef4cd4fb6c808826c875e5 +TextScriptImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/GameMain/DataTables/DialogLine.txt b/Assets/GameMain/DataTables/DialogLine.txt new file mode 100644 index 0000000..567ba54 --- /dev/null +++ b/Assets/GameMain/DataTables/DialogLine.txt @@ -0,0 +1,13 @@ +# 对话内容表 筛选用数据 +# Id SpeakerId Expression SpeakerName Direction Text Emphasis ChapterId DialogId +# int string ExpressionType string int string EmphasisType int int +# 对话行编号 策划备注 说话人Id 表情 显示人名 说话朝向 说话内容 演出效果 章节Id 对话Id + 100100001 Id规则为 Null None Null 0 相传。 None 1.00100001 1001.00001 + 100100002 第1位数为章节Id Null None Null 0 Mask。 None 1.00100002 1001.00002 + 100100003 第2-4位数为对话Id Null None Null 0 很好。 None 1.00100003 1001.00003 + 100200001 第5-9位数为对话行Id Xu Normal 徐晟壹 0 你好,王。 None 1.00200001 1002.00001 + 100200002 Wang Normal 王可嘉 1 你好,徐。 None 1.00200002 1002.00002 + 100200003 Master Normal 李诫 1 你们好。 None 1.00200003 1002.00003 + 100300001 Npc1 None Null 0 这人谁啊? None 1.00300001 1003.00001 + 100300002 Npc2 None Null 0 不知道啊? None 1.00300002 1003.00002 + 100300003 Npc1 None Null 0 不知道你在这干嘛。 None 1.00300003 1003.00003 diff --git a/Assets/GameMain/DataTables/DialogLine.txt.meta b/Assets/GameMain/DataTables/DialogLine.txt.meta new file mode 100644 index 0000000..316dc2f --- /dev/null +++ b/Assets/GameMain/DataTables/DialogLine.txt.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 378604b840f56ae49831978cf0e0a6ea +TextScriptImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/GameMain/DataTables/Scene.txt b/Assets/GameMain/DataTables/Scene.txt index 29826e2..10e008e 100644 --- a/Assets/GameMain/DataTables/Scene.txt +++ b/Assets/GameMain/DataTables/Scene.txt @@ -5,4 +5,4 @@ 1 菜单场景 Menu 1 2 战斗场景 Main 2 3 压力测试场景 StressTest 0 - 4 玩法A测试场景 GameplayA 0 \ No newline at end of file + 4 GameplayA 0 diff --git a/Assets/GameMain/DataTables/UIForm.txt b/Assets/GameMain/DataTables/UIForm.txt index f2b96f5..eccc80b 100644 --- a/Assets/GameMain/DataTables/UIForm.txt +++ b/Assets/GameMain/DataTables/UIForm.txt @@ -6,4 +6,7 @@ 100 主菜单 MenuForm Default False True 101 设置 SettingForm Default False True 102 关于 AboutForm Default False True - 103 �����淨A MVC���Խ��� CombineForm Default False True + 103 组装玩法UI CombineForm Default False False + 104 Mask对话UI MaskDialogForm Default False False + 105 Bottom对话UI BottomBoxDialogForm Default False False + 106 Bubble对话UI BubbleDialogForm Default True False diff --git a/Assets/GameMain/Scripts/Base/GameEntry.Custom.cs b/Assets/GameMain/Scripts/Base/GameEntry.Custom.cs index 73dfeb0..dd0d4d6 100644 --- a/Assets/GameMain/Scripts/Base/GameEntry.Custom.cs +++ b/Assets/GameMain/Scripts/Base/GameEntry.Custom.cs @@ -15,10 +15,12 @@ public partial class GameEntry : MonoBehaviour { public static BuiltinDataComponent BuiltinData { get; private set; } public static CombineComponent Combine { get; private set; } + public static DialogComponent Dialog { get; private set; } private static void InitCustomComponents() { BuiltinData = UnityGameFramework.Runtime.GameEntry.GetComponent(); Combine = UnityGameFramework.Runtime.GameEntry.GetComponent(); + Dialog = UnityGameFramework.Runtime.GameEntry.GetComponent(); } } diff --git a/Assets/GameMain/Scripts/BuiltinData.meta b/Assets/GameMain/Scripts/CustomComponent.meta similarity index 100% rename from Assets/GameMain/Scripts/BuiltinData.meta rename to Assets/GameMain/Scripts/CustomComponent.meta diff --git a/Assets/GameMain/Scripts/BuiltinData/BuiltinDataComponent.cs b/Assets/GameMain/Scripts/CustomComponent/BuiltinDataComponent.cs similarity index 100% rename from Assets/GameMain/Scripts/BuiltinData/BuiltinDataComponent.cs rename to Assets/GameMain/Scripts/CustomComponent/BuiltinDataComponent.cs diff --git a/Assets/GameMain/Scripts/BuiltinData/BuiltinDataComponent.cs.meta b/Assets/GameMain/Scripts/CustomComponent/BuiltinDataComponent.cs.meta similarity index 100% rename from Assets/GameMain/Scripts/BuiltinData/BuiltinDataComponent.cs.meta rename to Assets/GameMain/Scripts/CustomComponent/BuiltinDataComponent.cs.meta diff --git a/Assets/GameMain/Scripts/Gameplay/CoreGameplayA/CombineComponent.cs b/Assets/GameMain/Scripts/CustomComponent/CombineComponent.cs similarity index 99% rename from Assets/GameMain/Scripts/Gameplay/CoreGameplayA/CombineComponent.cs rename to Assets/GameMain/Scripts/CustomComponent/CombineComponent.cs index 6fa45f0..b4c880d 100644 --- a/Assets/GameMain/Scripts/Gameplay/CoreGameplayA/CombineComponent.cs +++ b/Assets/GameMain/Scripts/CustomComponent/CombineComponent.cs @@ -385,7 +385,7 @@ namespace CustomComponent /// private void RejectPlace(CombineDraggablePart part, string hint) { - part.ReturnToSpawn(); + part.ReturnToSpawnAnimated(); if (!string.IsNullOrEmpty(hint)) { diff --git a/Assets/GameMain/Scripts/Gameplay/CoreGameplayA/CombineComponent.cs.meta b/Assets/GameMain/Scripts/CustomComponent/CombineComponent.cs.meta similarity index 83% rename from Assets/GameMain/Scripts/Gameplay/CoreGameplayA/CombineComponent.cs.meta rename to Assets/GameMain/Scripts/CustomComponent/CombineComponent.cs.meta index 797c163..d791c80 100644 --- a/Assets/GameMain/Scripts/Gameplay/CoreGameplayA/CombineComponent.cs.meta +++ b/Assets/GameMain/Scripts/CustomComponent/CombineComponent.cs.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 0103c893efce444d9c6fe671306746fe +guid: cc0388c578bec9746813380eee9038d4 MonoImporter: externalObjects: {} serializedVersion: 2 diff --git a/Assets/GameMain/Scripts/CustomComponent/DialogComponent.cs b/Assets/GameMain/Scripts/CustomComponent/DialogComponent.cs new file mode 100644 index 0000000..0581337 --- /dev/null +++ b/Assets/GameMain/Scripts/CustomComponent/DialogComponent.cs @@ -0,0 +1,413 @@ +using System.Collections.Generic; +using DataTable; +using Definition.Enum; +using Event; +using GameFramework.DataTable; +using GameFramework.Event; +using UI; +using UnityEngine; +using UnityGameFramework.Runtime; + +namespace CustomComponent +{ + [DisallowMultipleComponent] + public class DialogComponent : GameFrameworkComponent + { + #region Property + + [SerializeField] private float _playingSpeed = 1.0f; + + private const int DialogChapterDivisor = 1000; + private const int LineChapterDivisor = 100000000; + private const int LineDialogDivisor = 100000; + + private readonly Dictionary _dialogMap = new(); + + private readonly Dictionary> _dialogLinesMap = new(); + + private readonly Dictionary _dialogFirstLineIdMap = new(); + + private IDataTable _dtDialog; + private IDataTable _dtDialogLine; + private DialogFormController _formController; + private DialogFormContext _formContext; + + private int _currentChapterId; + private int _currentLineIndex = -1; + private bool _isInitialized; + private bool _isPlaying; + + public float PlayingSpeed => _playingSpeed; + + public bool IsInitialized => _isInitialized; + + public bool IsPlaying => _isPlaying; + + public int CurrentChapterId => _currentChapterId; + + public int CurrentDialogId => _formContext != null ? _formContext.DialogId : 0; + + public int CurrentLineId => _formContext != null ? _formContext.CurrentLineId : 0; + + #endregion + + + private void Start() + { + GameEntry.Event.Subscribe(DialogNextLineRequestEventArgs.EventId, OnDialogNextLineRequest); + GameEntry.Event.Subscribe(DialogSkipRequestEventArgs.EventId, OnDialogSkipRequest); + GameEntry.Event.Subscribe(DialogStopRequestEventArgs.EventId, OnDialogStopRequest); + } + + private void OnDestroy() + { + GameEntry.Event.Unsubscribe(DialogNextLineRequestEventArgs.EventId, OnDialogNextLineRequest); + GameEntry.Event.Unsubscribe(DialogSkipRequestEventArgs.EventId, OnDialogSkipRequest); + GameEntry.Event.Unsubscribe(DialogStopRequestEventArgs.EventId, OnDialogStopRequest); + } + + public bool Init(int chapterId) + { + if (chapterId <= 0) + { + Log.Warning("Dialog init failed. chapterId must be positive."); + return false; + } + + if (!EnsureDataTables()) + { + return false; + } + + StopDialog(); + _dialogMap.Clear(); + _dialogLinesMap.Clear(); + _dialogFirstLineIdMap.Clear(); + + DRDialog[] dialogRows = _dtDialog.GetDataRows((a, b) => a.Id.CompareTo(b.Id)); + for (int i = 0; i < dialogRows.Length; i++) + { + DRDialog dialogRow = dialogRows[i]; + if (dialogRow == null) + { + continue; + } + + if (ParseChapterIdFromDialogId(dialogRow.Id) != chapterId) + { + continue; + } + + _dialogMap[dialogRow.Id] = dialogRow; + } + + if (_dialogMap.Count == 0) + { + Log.Warning("Dialog init failed. No dialog rows found for chapter '{0}'.", chapterId.ToString()); + return false; + } + + DRDialogLine[] lineRows = _dtDialogLine.GetDataRows((a, b) => a.Id.CompareTo(b.Id)); + for (int i = 0; i < lineRows.Length; i++) + { + DRDialogLine lineRow = lineRows[i]; + if (lineRow == null) + { + continue; + } + + if (ParseChapterIdFromLineId(lineRow.Id) != chapterId) + { + continue; + } + + int dialogId = ParseDialogIdFromLineId(lineRow.Id); + if (!_dialogMap.ContainsKey(dialogId)) + { + continue; + } + + if (!_dialogLinesMap.TryGetValue(dialogId, out List dialogLines)) + { + dialogLines = new List(); + _dialogLinesMap.Add(dialogId, dialogLines); + } + + dialogLines.Add(lineRow); + } + + List invalidDialogIds = new List(); + foreach (KeyValuePair dialogPair in _dialogMap) + { + if (!_dialogLinesMap.TryGetValue(dialogPair.Key, out List dialogLines) || + dialogLines.Count == 0) + { + Log.Warning("Dialog init warning. Dialog '{0}' has no lines and will be ignored.", + dialogPair.Key.ToString()); + invalidDialogIds.Add(dialogPair.Key); + continue; + } + + dialogLines.Sort((a, b) => a.Id.CompareTo(b.Id)); + _dialogFirstLineIdMap[dialogPair.Key] = dialogLines[0].Id; + } + + for (int i = 0; i < invalidDialogIds.Count; i++) + { + _dialogMap.Remove(invalidDialogIds[i]); + } + + if (_dialogMap.Count == 0) + { + Log.Warning("Dialog init failed. No valid dialog remains for chapter '{0}'.", chapterId.ToString()); + return false; + } + + EnsureFormController(); + _formContext = null; + _currentChapterId = chapterId; + _currentLineIndex = -1; + _isInitialized = true; + _isPlaying = false; + return true; + } + + public bool StartDialog(int dialogId) + { + if (!_isInitialized) + { + Log.Warning("Start dialog failed. Dialog component is not initialized."); + return false; + } + + if (ParseChapterIdFromDialogId(dialogId) != _currentChapterId) + { + Log.Warning("Start dialog failed. Dialog '{0}' does not belong to chapter '{1}'.", dialogId.ToString(), + _currentChapterId.ToString()); + return false; + } + + if (!_dialogMap.TryGetValue(dialogId, out DRDialog dialogRow)) + { + Log.Warning("Start dialog failed. Dialog '{0}' was not found in current chapter cache.", + dialogId.ToString()); + return false; + } + + if (!_dialogLinesMap.TryGetValue(dialogId, out List dialogLines) || dialogLines.Count == 0) + { + Log.Warning("Start dialog failed. Dialog '{0}' has no playable lines.", dialogId.ToString()); + return false; + } + + if (_isPlaying) + { + StopDialog(); + } + + EnsureFormController(); + if (_formContext == null) + { + _formContext = new DialogFormContext(); + } + + _formContext.ChapterId = _currentChapterId; + _formContext.DialogId = dialogRow.Id; + _formContext.DialogTitle = dialogRow.Title; + _formContext.DialogUIMode = dialogRow.UIMode; + _formContext.PlayingSpeed = Mathf.Max(0f, _playingSpeed); + + _currentLineIndex = 0; + ApplyLineToContext(dialogLines[_currentLineIndex], _currentLineIndex, dialogLines.Count); + _isPlaying = true; + + _formController.OpenUI(_formContext); + _formController.OnDialogStarted(_formContext); + _formController.OnDialogLineChanged(_formContext); + return true; + } + + public bool NextLine() + { + if (!_isPlaying) + { + Log.Warning("Next line failed. No dialog is playing."); + return false; + } + + if (!TryGetCurrentDialogLines(out List dialogLines)) + { + StopDialog(); + return false; + } + + int nextLineIndex = _currentLineIndex + 1; + if (nextLineIndex >= dialogLines.Count) + { + EndDialogInternal(); + return true; + } + + _currentLineIndex = nextLineIndex; + ApplyLineToContext(dialogLines[_currentLineIndex], _currentLineIndex, dialogLines.Count); + _formController.OnDialogLineChanged(_formContext); + return true; + } + + public bool SkipDialog() + { + if (!_isPlaying) + { + Log.Warning("Skip dialog failed. No dialog is playing."); + return false; + } + + EndDialogInternal(); + return true; + } + + public void StopDialog() + { + if (!_isPlaying) + { + return; + } + + EndDialogInternal(); + } + + public void ClearRuntimeContext() + { + StopDialog(); + + _dialogMap.Clear(); + _dialogLinesMap.Clear(); + _dialogFirstLineIdMap.Clear(); + + _formContext = null; + _currentChapterId = 0; + _currentLineIndex = -1; + _isInitialized = false; + _isPlaying = false; + } + + private bool EnsureDataTables() + { + _dtDialog = GameEntry.DataTable.GetDataTable(); + if (_dtDialog == null) + { + Log.Warning("Dialog init failed. Data table DRDialog is missing."); + return false; + } + + _dtDialogLine = GameEntry.DataTable.GetDataTable(); + if (_dtDialogLine == null) + { + Log.Warning("Dialog init failed. Data table DRDialogLine is missing."); + return false; + } + + return true; + } + + private void EnsureFormController() + { + if (_formController == null) + { + _formController = new DialogFormController(); + } + } + + private bool TryGetCurrentDialogLines(out List dialogLines) + { + dialogLines = null; + if (_formContext == null) + { + Log.Warning("Dialog state invalid. Form context is null."); + return false; + } + + if (!_dialogLinesMap.TryGetValue(_formContext.DialogId, out dialogLines)) + { + Log.Warning("Dialog state invalid. Dialog lines are missing for dialog '{0}'.", + _formContext.DialogId.ToString()); + return false; + } + + return true; + } + + private void EndDialogInternal() + { + _isPlaying = false; + _currentLineIndex = -1; + + _formController.OnDialogEnded(_formContext); + _formController.CloseUI(); + } + + private void ApplyLineToContext(DRDialogLine lineRow, int lineIndex, int totalLines) + { + _formContext.CurrentLineId = lineRow.Id; + _formContext.SpeakerId = lineRow.SpeakerId; + _formContext.SpeakerName = lineRow.SpeakerName; + _formContext.Expression = lineRow.Expression; + _formContext.Direction = lineRow.Direction; + _formContext.Text = lineRow.Text; + _formContext.Emphasis = lineRow.Emphasis; + _formContext.PlayingSpeed = Mathf.Max(0f, _playingSpeed); + _formContext.LineIndex = lineIndex; + _formContext.TotalLines = totalLines; + _formContext.IsLastLine = lineIndex >= totalLines - 1; + } + + private static int ParseChapterIdFromDialogId(int dialogId) + { + return dialogId / DialogChapterDivisor; + } + + private static int ParseChapterIdFromLineId(int lineId) + { + return lineId / LineChapterDivisor; + } + + private static int ParseDialogIdFromLineId(int lineId) + { + return lineId / LineDialogDivisor; + } + + #region Event Handlers + + private void OnDialogNextLineRequest(object sender, GameEventArgs e) + { + if (!(e is DialogNextLineRequestEventArgs)) + { + return; + } + + NextLine(); + } + + private void OnDialogSkipRequest(object sender, GameEventArgs e) + { + if (!(e is DialogSkipRequestEventArgs)) + { + return; + } + + SkipDialog(); + } + + private void OnDialogStopRequest(object sender, GameEventArgs e) + { + if (!(e is DialogStopRequestEventArgs)) + { + return; + } + + StopDialog(); + } + + #endregion + } +} diff --git a/Assets/GameMain/Scripts/CustomComponent/DialogComponent.cs.meta b/Assets/GameMain/Scripts/CustomComponent/DialogComponent.cs.meta new file mode 100644 index 0000000..bdcaace --- /dev/null +++ b/Assets/GameMain/Scripts/CustomComponent/DialogComponent.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: d6174838c30e460429e5628757bbf015 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/GameMain/Scripts/CustomComponent/SpriteCacheComponent.cs b/Assets/GameMain/Scripts/CustomComponent/SpriteCacheComponent.cs new file mode 100644 index 0000000..a9af45e --- /dev/null +++ b/Assets/GameMain/Scripts/CustomComponent/SpriteCacheComponent.cs @@ -0,0 +1,72 @@ +using System; +using System.Collections.Generic; +using CustomUtility; +using Definition; +using GameFramework.Resource; +using UnityEngine; +using UnityGameFramework.Runtime; + +namespace CustomComponent +{ + public class SpriteCacheComponent : GameFrameworkComponent + { + [SerializeField] private float _pixelsPerUnit = 100f; + [SerializeField] private Vector2 _defaultPivot = new(0.5f, 0.5f); + + private Dictionary _spriteCache; + private ResourceComponent _resource; + + void Start() + { + _spriteCache = new Dictionary(); + _resource = GameEntry.Resource; + } + + public void GetSprite(string assetName, Action callback) + { + if (_spriteCache.TryGetValue(assetName, out var sprite)) + { + callback?.Invoke(sprite); + return; + } + else + { + _resource.LoadAsset + ( + AssetUtility.GetUIDialogAsset(assetName), + Constant.AssetPriority.UIFormAsset, + new LoadAssetCallbacks( + (resourcePath, asset, duration, userData) => + { + Log.Debug(resourcePath); + Texture2D texture = asset as Texture2D; + if (texture != null) + { + Sprite newSprite = Sprite.Create( + texture, + new Rect(0, 0, texture.width, texture.height), + _defaultPivot, + _pixelsPerUnit); + _spriteCache.Add(assetName, newSprite); + callback?.Invoke(newSprite); + } + }, + (resourcePath, status, errorMessage, userData) => + { + Log.Error("Can not load icon '{0}' from '{1}' with error message '{2}'.", + assetName, + resourcePath, + errorMessage); + } + ) + ); + } + } + + private void OnDestroy() + { + _spriteCache.Clear(); + _resource = null; + } + } +} \ No newline at end of file diff --git a/Assets/GameMain/Scripts/CustomComponent/SpriteCacheComponent.cs.meta b/Assets/GameMain/Scripts/CustomComponent/SpriteCacheComponent.cs.meta new file mode 100644 index 0000000..68ce095 --- /dev/null +++ b/Assets/GameMain/Scripts/CustomComponent/SpriteCacheComponent.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 42b4751aefa33c545a86f146a48536ee +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/GameMain/Scripts/DataTable/BinaryReaderExtension.cs b/Assets/GameMain/Scripts/DataTable/BinaryReaderExtension.cs index c38ba21..585d668 100644 --- a/Assets/GameMain/Scripts/DataTable/BinaryReaderExtension.cs +++ b/Assets/GameMain/Scripts/DataTable/BinaryReaderExtension.cs @@ -9,7 +9,7 @@ using System; using System.IO; using UnityEngine; -namespace StarForce +namespace DataTable { public static class BinaryReaderExtension { diff --git a/Assets/GameMain/Scripts/DataTable/DRDialog.cs b/Assets/GameMain/Scripts/DataTable/DRDialog.cs new file mode 100644 index 0000000..92476e0 --- /dev/null +++ b/Assets/GameMain/Scripts/DataTable/DRDialog.cs @@ -0,0 +1,39 @@ +using CustomUtility; +using Definition.Enum; +using UnityGameFramework.Runtime; + +namespace DataTable +{ + public class DRDialog : DataRowBase + { + private int m_Id; + + /// + /// 获取对话编号。 + /// + public override int Id => m_Id; + + /// + /// 获取对话标识。 + /// + public string Title { get; private set; } + + /// + /// 获取对话形式。 + /// + public DialogFormMode UIMode { get; private set; } + + public override bool ParseDataRow(string dataRowString, object userData) + { + string[] fields = dataRowString.Split('\t'); + + int index = 1; + m_Id = int.Parse(fields[index++]); + index++; + Title = fields[index++]; + UIMode = EnumUtility.Get(fields[index++]); + + return true; + } + } +} \ No newline at end of file diff --git a/Assets/GameMain/Scripts/DataTable/DRDialog.cs.meta b/Assets/GameMain/Scripts/DataTable/DRDialog.cs.meta new file mode 100644 index 0000000..a22d4d9 --- /dev/null +++ b/Assets/GameMain/Scripts/DataTable/DRDialog.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: fb12692f2a7e6174eae3b0d28c769e55 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/GameMain/Scripts/DataTable/DRDialogLine.cs b/Assets/GameMain/Scripts/DataTable/DRDialogLine.cs new file mode 100644 index 0000000..fb888dd --- /dev/null +++ b/Assets/GameMain/Scripts/DataTable/DRDialogLine.cs @@ -0,0 +1,64 @@ +using CustomUtility; +using Definition.Enum; +using UnityGameFramework.Runtime; + +namespace DataTable +{ + public class DRDialogLine : DataRowBase + { + private int m_Id; + + /// + /// 获取对话行编号 + /// + public override int Id => m_Id; + + /// + /// 获取说话人 Id。 + /// + public string SpeakerId { get; private set; } + + /// + /// 获取说话人表情。 + /// + public ExpressionType Expression { get; private set; } + + /// + /// 获取说话人显示名。 + /// + public string SpeakerName { get; private set; } + + /// + /// 获取说话人朝向。 + /// + public int Direction { get; private set; } + + /// + /// 获取对话内容。 + /// + public string Text { get; private set; } + + /// + /// 获取对话效果。 + /// + public EmphasisType Emphasis { get; private set; } + + public override bool ParseDataRow(string dataRowString, object userData) + { + string[] fields = dataRowString.Split('\t'); + + int index = 0; + index++; + m_Id = int.Parse(fields[index++]); + index++; + SpeakerId = fields[index++]; + Expression = EnumUtility.Get(fields[index++]); + SpeakerName = fields[index++]; + Direction = int.Parse(fields[index++]); + Text = fields[index++]; + Emphasis = EnumUtility.Get(fields[index++]); + + return true; + } + } +} \ No newline at end of file diff --git a/Assets/GameMain/Scripts/DataTable/DRDialogLine.cs.meta b/Assets/GameMain/Scripts/DataTable/DRDialogLine.cs.meta new file mode 100644 index 0000000..d4e701e --- /dev/null +++ b/Assets/GameMain/Scripts/DataTable/DRDialogLine.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: fc6d3e8e61ab627488e22bb5fc28f95d +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/GameMain/Scripts/DataTable/DREntity.cs b/Assets/GameMain/Scripts/DataTable/DREntity.cs index 84fe1b2..e89ffa6 100644 --- a/Assets/GameMain/Scripts/DataTable/DREntity.cs +++ b/Assets/GameMain/Scripts/DataTable/DREntity.cs @@ -16,7 +16,7 @@ using System.Text; using UnityEngine; using UnityGameFramework.Runtime; -namespace StarForce +namespace DataTable { /// /// 实体表。 @@ -28,13 +28,7 @@ namespace StarForce /// /// 获取实体编号。 /// - public override int Id - { - get - { - return m_Id; - } - } + public override int Id => m_Id; /// /// 获取资源名称。 diff --git a/Assets/GameMain/Scripts/DataTable/DRMusic.cs b/Assets/GameMain/Scripts/DataTable/DRMusic.cs index 7bad7ce..83b2a31 100644 --- a/Assets/GameMain/Scripts/DataTable/DRMusic.cs +++ b/Assets/GameMain/Scripts/DataTable/DRMusic.cs @@ -16,7 +16,7 @@ using System.Text; using UnityEngine; using UnityGameFramework.Runtime; -namespace StarForce +namespace DataTable { /// /// 音乐配置表。 diff --git a/Assets/GameMain/Scripts/DataTable/DRScene.cs b/Assets/GameMain/Scripts/DataTable/DRScene.cs index af6154e..d68a454 100644 --- a/Assets/GameMain/Scripts/DataTable/DRScene.cs +++ b/Assets/GameMain/Scripts/DataTable/DRScene.cs @@ -1,22 +1,8 @@ -//------------------------------------------------------------ -// Game Framework -// Copyright © 2013-2021 Jiang Yin. All rights reserved. -// Homepage: https://gameframework.cn/ -// Feedback: mailto:ellan@gameframework.cn -//------------------------------------------------------------ -// 此文件由工具自动生成,请勿直接修改。 -// 生成时间:2021-06-16 21:54:35.610 -//------------------------------------------------------------ - -using GameFramework; -using System; -using System.Collections.Generic; -using System.IO; +using System.IO; using System.Text; -using UnityEngine; using UnityGameFramework.Runtime; -namespace StarForce +namespace DataTable { /// /// 场景配置表。 diff --git a/Assets/GameMain/Scripts/DataTable/DRSound.cs b/Assets/GameMain/Scripts/DataTable/DRSound.cs index 0ce1445..fe12887 100644 --- a/Assets/GameMain/Scripts/DataTable/DRSound.cs +++ b/Assets/GameMain/Scripts/DataTable/DRSound.cs @@ -1,22 +1,8 @@ -//------------------------------------------------------------ -// Game Framework -// Copyright © 2013-2021 Jiang Yin. All rights reserved. -// Homepage: https://gameframework.cn/ -// Feedback: mailto:ellan@gameframework.cn -//------------------------------------------------------------ -// 此文件由工具自动生成,请勿直接修改。 -// 生成时间:2021-06-16 21:54:35.625 -//------------------------------------------------------------ - -using GameFramework; -using System; -using System.Collections.Generic; -using System.IO; +using System.IO; using System.Text; -using UnityEngine; using UnityGameFramework.Runtime; -namespace StarForce +namespace DataTable { /// /// 声音配置表。 diff --git a/Assets/GameMain/Scripts/DataTable/DRUIForm.cs b/Assets/GameMain/Scripts/DataTable/DRUIForm.cs index 80f914b..712d3be 100644 --- a/Assets/GameMain/Scripts/DataTable/DRUIForm.cs +++ b/Assets/GameMain/Scripts/DataTable/DRUIForm.cs @@ -1,14 +1,4 @@ -//------------------------------------------------------------ -// Game Framework -// Copyright © 2013-2021 Jiang Yin. All rights reserved. -// Homepage: https://gameframework.cn/ -// Feedback: mailto:ellan@gameframework.cn -//------------------------------------------------------------ -// 此文件由工具自动生成,请勿直接修改。 -// 生成时间:2021-06-16 21:54:35.652 -//------------------------------------------------------------ - -using GameFramework; +using GameFramework; using System; using System.Collections.Generic; using System.IO; @@ -16,7 +6,7 @@ using System.Text; using UnityEngine; using UnityGameFramework.Runtime; -namespace StarForce +namespace DataTable { /// /// 界面配置表。 diff --git a/Assets/GameMain/Scripts/DataTable/DRUISound.cs b/Assets/GameMain/Scripts/DataTable/DRUISound.cs index e303c18..db77bc7 100644 --- a/Assets/GameMain/Scripts/DataTable/DRUISound.cs +++ b/Assets/GameMain/Scripts/DataTable/DRUISound.cs @@ -1,14 +1,4 @@ -//------------------------------------------------------------ -// Game Framework -// Copyright © 2013-2021 Jiang Yin. All rights reserved. -// Homepage: https://gameframework.cn/ -// Feedback: mailto:ellan@gameframework.cn -//------------------------------------------------------------ -// 此文件由工具自动生成,请勿直接修改。 -// 生成时间:2021-06-16 21:54:35.666 -//------------------------------------------------------------ - -using GameFramework; +using GameFramework; using System; using System.Collections.Generic; using System.IO; @@ -16,7 +6,7 @@ using System.Text; using UnityEngine; using UnityGameFramework.Runtime; -namespace StarForce +namespace DataTable { /// /// 声音配置表。 diff --git a/Assets/GameMain/Scripts/DataTable/DataTableExtension.cs b/Assets/GameMain/Scripts/DataTable/DataTableExtension.cs index 5e82897..b114cf2 100644 --- a/Assets/GameMain/Scripts/DataTable/DataTableExtension.cs +++ b/Assets/GameMain/Scripts/DataTable/DataTableExtension.cs @@ -1,20 +1,14 @@ -//------------------------------------------------------------ -// Game Framework -// Copyright © 2013-2021 Jiang Yin. All rights reserved. -// Homepage: https://gameframework.cn/ -// Feedback: mailto:ellan@gameframework.cn -//------------------------------------------------------------ - -using GameFramework.DataTable; +using GameFramework.DataTable; using System; +using Definition; using UnityEngine; using UnityGameFramework.Runtime; -namespace StarForce +namespace DataTable { public static class DataTableExtension { - private const string DataRowClassPrefixName = "StarForce.DR"; + private const string DataRowClassPrefixName = "DataTable.DR"; internal static readonly char[] DataSplitSeparators = new char[] { '\t' }; internal static readonly char[] DataTrimSeparators = new char[] { '\"' }; diff --git a/Assets/GameMain/Scripts/Debugger/ChangeLanguageDebuggerWindow.cs b/Assets/GameMain/Scripts/Debugger/ChangeLanguageDebuggerWindow.cs index 32d46c4..b1632bb 100644 --- a/Assets/GameMain/Scripts/Debugger/ChangeLanguageDebuggerWindow.cs +++ b/Assets/GameMain/Scripts/Debugger/ChangeLanguageDebuggerWindow.cs @@ -5,6 +5,7 @@ // Feedback: mailto:ellan@gameframework.cn //------------------------------------------------------------ +using Definition; using GameFramework.Debugger; using GameFramework.Localization; using UnityEngine; diff --git a/Assets/GameMain/Scripts/Definition/Constant/Constant.AssetPriority.cs b/Assets/GameMain/Scripts/Definition/Constant/Constant.AssetPriority.cs index 9d1c0b9..6c863b6 100644 --- a/Assets/GameMain/Scripts/Definition/Constant/Constant.AssetPriority.cs +++ b/Assets/GameMain/Scripts/Definition/Constant/Constant.AssetPriority.cs @@ -5,7 +5,7 @@ // Feedback: mailto:ellan@gameframework.cn //------------------------------------------------------------ -namespace StarForce +namespace Definition { public static partial class Constant { diff --git a/Assets/GameMain/Scripts/Definition/Constant/Constant.Layer.cs b/Assets/GameMain/Scripts/Definition/Constant/Constant.Layer.cs index 29c6cda..3f89d5b 100644 --- a/Assets/GameMain/Scripts/Definition/Constant/Constant.Layer.cs +++ b/Assets/GameMain/Scripts/Definition/Constant/Constant.Layer.cs @@ -7,7 +7,7 @@ using UnityEngine; -namespace StarForce +namespace Definition { public static partial class Constant { diff --git a/Assets/GameMain/Scripts/Definition/Constant/Constant.Setting.cs b/Assets/GameMain/Scripts/Definition/Constant/Constant.Setting.cs index 05e6037..1595633 100644 --- a/Assets/GameMain/Scripts/Definition/Constant/Constant.Setting.cs +++ b/Assets/GameMain/Scripts/Definition/Constant/Constant.Setting.cs @@ -5,7 +5,7 @@ // Feedback: mailto:ellan@gameframework.cn //------------------------------------------------------------ -namespace StarForce +namespace Definition { public static partial class Constant { diff --git a/Assets/GameMain/Scripts/Definition/Enum/DialogFormMode.cs b/Assets/GameMain/Scripts/Definition/Enum/DialogFormMode.cs new file mode 100644 index 0000000..07c32ee --- /dev/null +++ b/Assets/GameMain/Scripts/Definition/Enum/DialogFormMode.cs @@ -0,0 +1,22 @@ +namespace Definition.Enum +{ + public enum DialogFormMode + { + None = 0, + + /// + /// 黑屏白字 + /// + Mask = 1, + + /// + /// 底部对话框 + /// + BottomBox = 2, + + /// + /// 对话气泡 + /// + Bubble = 3 + } +} \ No newline at end of file diff --git a/Assets/GameMain/Scripts/Definition/Enum/DialogFormMode.cs.meta b/Assets/GameMain/Scripts/Definition/Enum/DialogFormMode.cs.meta new file mode 100644 index 0000000..9b7298a --- /dev/null +++ b/Assets/GameMain/Scripts/Definition/Enum/DialogFormMode.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 7a10763d137f413d828c534b0233f2a6 +timeCreated: 1770600423 \ No newline at end of file diff --git a/Assets/GameMain/Scripts/Definition/Enum/EmphasisType.cs b/Assets/GameMain/Scripts/Definition/Enum/EmphasisType.cs new file mode 100644 index 0000000..642dba9 --- /dev/null +++ b/Assets/GameMain/Scripts/Definition/Enum/EmphasisType.cs @@ -0,0 +1,13 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +namespace Definition.Enum +{ + public enum EmphasisType + { + None, + Shake, + Blink, + } +} \ No newline at end of file diff --git a/Assets/GameMain/Scripts/Definition/Enum/EmphasisType.cs.meta b/Assets/GameMain/Scripts/Definition/Enum/EmphasisType.cs.meta new file mode 100644 index 0000000..793bc8e --- /dev/null +++ b/Assets/GameMain/Scripts/Definition/Enum/EmphasisType.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 96908bdc885697e4d9cb0f6627d13230 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/GameMain/Scripts/Definition/Enum/ExpressionType.cs b/Assets/GameMain/Scripts/Definition/Enum/ExpressionType.cs new file mode 100644 index 0000000..55ec0e3 --- /dev/null +++ b/Assets/GameMain/Scripts/Definition/Enum/ExpressionType.cs @@ -0,0 +1,14 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +namespace Definition.Enum +{ + public enum ExpressionType + { + None, + Normal, + Shock, + Happy, + } +} \ No newline at end of file diff --git a/Assets/GameMain/Scripts/Definition/Enum/ExpressionType.cs.meta b/Assets/GameMain/Scripts/Definition/Enum/ExpressionType.cs.meta new file mode 100644 index 0000000..664286a --- /dev/null +++ b/Assets/GameMain/Scripts/Definition/Enum/ExpressionType.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 174e046d822a14d49843dc415067f13c +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/GameMain/Scripts/UI/UIFormId.cs b/Assets/GameMain/Scripts/Definition/Enum/UIFormId.cs similarity index 72% rename from Assets/GameMain/Scripts/UI/UIFormId.cs rename to Assets/GameMain/Scripts/Definition/Enum/UIFormId.cs index 68e9590..f3ca7c5 100644 --- a/Assets/GameMain/Scripts/UI/UIFormId.cs +++ b/Assets/GameMain/Scripts/Definition/Enum/UIFormId.cs @@ -38,5 +38,20 @@ namespace UI /// 核心玩法A MVC测试界面。 /// CombineForm = 103, + + /// + /// 蒙版剧情对话界面。 + /// + MaskDialogForm = 104, + + /// + /// 底部剧情对话界面。 + /// + BottomBoxDialogForm = 105, + + /// + /// 气泡剧情对话界面。 + /// + BubbleDialogForm = 106, } } diff --git a/Assets/GameMain/Scripts/UI/UIFormId.cs.meta b/Assets/GameMain/Scripts/Definition/Enum/UIFormId.cs.meta similarity index 100% rename from Assets/GameMain/Scripts/UI/UIFormId.cs.meta rename to Assets/GameMain/Scripts/Definition/Enum/UIFormId.cs.meta diff --git a/Assets/GameMain/Scripts/Entity/EntityExtension.cs b/Assets/GameMain/Scripts/Entity/EntityExtension.cs index 2f99f10..6d0da7a 100644 --- a/Assets/GameMain/Scripts/Entity/EntityExtension.cs +++ b/Assets/GameMain/Scripts/Entity/EntityExtension.cs @@ -7,6 +7,8 @@ using GameFramework.DataTable; using System; +using CustomUtility; +using DataTable; using Entity; using Entity.EntityData; using UnityGameFramework.Runtime; diff --git a/Assets/GameMain/Scripts/Event/DialogNextLineRequestEventArgs.cs b/Assets/GameMain/Scripts/Event/DialogNextLineRequestEventArgs.cs new file mode 100644 index 0000000..0fe2c5d --- /dev/null +++ b/Assets/GameMain/Scripts/Event/DialogNextLineRequestEventArgs.cs @@ -0,0 +1,21 @@ +using GameFramework; +using GameFramework.Event; + +namespace Event +{ + public class DialogNextLineRequestEventArgs : GameEventArgs + { + public static readonly int EventId = typeof(DialogNextLineRequestEventArgs).GetHashCode(); + + public override int Id => EventId; + + public static DialogNextLineRequestEventArgs Create() + { + return ReferencePool.Acquire(); + } + + public override void Clear() + { + } + } +} diff --git a/Assets/GameMain/Scripts/Event/DialogNextLineRequestEventArgs.cs.meta b/Assets/GameMain/Scripts/Event/DialogNextLineRequestEventArgs.cs.meta new file mode 100644 index 0000000..687f94a --- /dev/null +++ b/Assets/GameMain/Scripts/Event/DialogNextLineRequestEventArgs.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: de8ad9563f91a584da8c775e9fa916b5 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/GameMain/Scripts/Event/DialogSkipRequestEventArgs.cs b/Assets/GameMain/Scripts/Event/DialogSkipRequestEventArgs.cs new file mode 100644 index 0000000..a470899 --- /dev/null +++ b/Assets/GameMain/Scripts/Event/DialogSkipRequestEventArgs.cs @@ -0,0 +1,21 @@ +using GameFramework; +using GameFramework.Event; + +namespace Event +{ + public class DialogSkipRequestEventArgs : GameEventArgs + { + public static readonly int EventId = typeof(DialogSkipRequestEventArgs).GetHashCode(); + + public override int Id => EventId; + + public static DialogSkipRequestEventArgs Create() + { + return ReferencePool.Acquire(); + } + + public override void Clear() + { + } + } +} diff --git a/Assets/GameMain/Scripts/Event/DialogSkipRequestEventArgs.cs.meta b/Assets/GameMain/Scripts/Event/DialogSkipRequestEventArgs.cs.meta new file mode 100644 index 0000000..e677f6c --- /dev/null +++ b/Assets/GameMain/Scripts/Event/DialogSkipRequestEventArgs.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: df023ccfed92923439c0f66ca1bd457c +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/GameMain/Scripts/Event/DialogStopRequestEventArgs.cs b/Assets/GameMain/Scripts/Event/DialogStopRequestEventArgs.cs new file mode 100644 index 0000000..e00aceb --- /dev/null +++ b/Assets/GameMain/Scripts/Event/DialogStopRequestEventArgs.cs @@ -0,0 +1,21 @@ +using GameFramework; +using GameFramework.Event; + +namespace Event +{ + public class DialogStopRequestEventArgs : GameEventArgs + { + public static readonly int EventId = typeof(DialogStopRequestEventArgs).GetHashCode(); + + public override int Id => EventId; + + public static DialogStopRequestEventArgs Create() + { + return ReferencePool.Acquire(); + } + + public override void Clear() + { + } + } +} diff --git a/Assets/GameMain/Scripts/Event/DialogStopRequestEventArgs.cs.meta b/Assets/GameMain/Scripts/Event/DialogStopRequestEventArgs.cs.meta new file mode 100644 index 0000000..cce9b8d --- /dev/null +++ b/Assets/GameMain/Scripts/Event/DialogStopRequestEventArgs.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 8d49a133afe91ef4e9bc7502e7adc71b +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/GameMain/Scripts/Procedure/BuiltIn/ProcedureChangeScene.cs b/Assets/GameMain/Scripts/Procedure/BuiltIn/ProcedureChangeScene.cs index d357d7d..97e9998 100644 --- a/Assets/GameMain/Scripts/Procedure/BuiltIn/ProcedureChangeScene.cs +++ b/Assets/GameMain/Scripts/Procedure/BuiltIn/ProcedureChangeScene.cs @@ -1,10 +1,6 @@ -//------------------------------------------------------------ -// Game Framework -// Copyright © 2013-2021 Jiang Yin. All rights reserved. -// Homepage: https://gameframework.cn/ -// Feedback: mailto:ellan@gameframework.cn -//------------------------------------------------------------ - +using CustomUtility; +using DataTable; +using Definition; using GameFramework.DataTable; using GameFramework.Event; using Scene; diff --git a/Assets/GameMain/Scripts/Procedure/BuiltIn/ProcedureLaunch.cs b/Assets/GameMain/Scripts/Procedure/BuiltIn/ProcedureLaunch.cs index 6b8e9bc..f86746a 100644 --- a/Assets/GameMain/Scripts/Procedure/BuiltIn/ProcedureLaunch.cs +++ b/Assets/GameMain/Scripts/Procedure/BuiltIn/ProcedureLaunch.cs @@ -1,12 +1,6 @@ -//------------------------------------------------------------ -// Game Framework -// Copyright © 2013-2021 Jiang Yin. All rights reserved. -// Homepage: https://gameframework.cn/ -// Feedback: mailto:ellan@gameframework.cn -//------------------------------------------------------------ - -using GameFramework.Localization; +using GameFramework.Localization; using System; +using Definition; using StarForce; using UnityGameFramework.Runtime; using ProcedureOwner = GameFramework.Fsm.IFsm; diff --git a/Assets/GameMain/Scripts/Procedure/BuiltIn/ProcedurePreload.cs b/Assets/GameMain/Scripts/Procedure/BuiltIn/ProcedurePreload.cs index 0b98cf8..d517acd 100644 --- a/Assets/GameMain/Scripts/Procedure/BuiltIn/ProcedurePreload.cs +++ b/Assets/GameMain/Scripts/Procedure/BuiltIn/ProcedurePreload.cs @@ -1,15 +1,10 @@ -//------------------------------------------------------------ -// Game Framework -// Copyright © 2013-2021 Jiang Yin. All rights reserved. -// Homepage: https://gameframework.cn/ -// Feedback: mailto:ellan@gameframework.cn -//------------------------------------------------------------ - -using GameFramework; +using GameFramework; using GameFramework.Event; using GameFramework.Resource; using System.Collections.Generic; -using StarForce; +using CustomUtility; +using DataTable; +using Definition; using TMPro; using UI; using UnityEngine; @@ -28,6 +23,8 @@ namespace Procedure "Sound", "UIForm", "UISound", + "Dialog", + "DialogLine" }; private Dictionary _loadedFlag = new Dictionary(); diff --git a/Assets/GameMain/Scripts/Procedure/ProcedureCombine.cs b/Assets/GameMain/Scripts/Procedure/ProcedureCombine.cs index 2d2be32..08ad6fd 100644 --- a/Assets/GameMain/Scripts/Procedure/ProcedureCombine.cs +++ b/Assets/GameMain/Scripts/Procedure/ProcedureCombine.cs @@ -87,7 +87,11 @@ namespace Procedure { base.OnEnter(procedureOwner); - InitializeProcedureState(); + //InitializeProcedureState(); + GameEntry.Dialog.Init(1); + + //GameEntry.Dialog.StartDialog(1001); + GameEntry.Dialog.StartDialog(1002); } /// @@ -109,12 +113,16 @@ namespace Procedure { base.OnUpdate(procedureOwner, elapseSeconds, realElapseSeconds); - if (TryUpdateRound(realElapseSeconds)) + if (GameEntry.Dialog.IsInitialized) { - return; + } - - TryRestartScene(procedureOwner, realElapseSeconds); + // if (TryUpdateRound(realElapseSeconds)) + // { + // return; + // } + // + // TryRestartScene(procedureOwner, realElapseSeconds); } #endregion diff --git a/Assets/GameMain/Scripts/Sound/SoundExtension.cs b/Assets/GameMain/Scripts/Sound/SoundExtension.cs index 518fd5d..d8fce21 100644 --- a/Assets/GameMain/Scripts/Sound/SoundExtension.cs +++ b/Assets/GameMain/Scripts/Sound/SoundExtension.cs @@ -5,6 +5,9 @@ // Feedback: mailto:ellan@gameframework.cn //------------------------------------------------------------ +using CustomUtility; +using DataTable; +using Definition; using Entity; using GameFramework; using GameFramework.DataTable; diff --git a/Assets/GameMain/Scripts/UI/Base.meta b/Assets/GameMain/Scripts/UI/Base.meta new file mode 100644 index 0000000..4c418c7 --- /dev/null +++ b/Assets/GameMain/Scripts/UI/Base.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 8cb383e8977814343a630c164eed6c51 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/GameMain/Scripts/UI/IFormController.cs b/Assets/GameMain/Scripts/UI/Base/IFormController.cs similarity index 100% rename from Assets/GameMain/Scripts/UI/IFormController.cs rename to Assets/GameMain/Scripts/UI/Base/IFormController.cs diff --git a/Assets/GameMain/Scripts/UI/IFormController.cs.meta b/Assets/GameMain/Scripts/UI/Base/IFormController.cs.meta similarity index 100% rename from Assets/GameMain/Scripts/UI/IFormController.cs.meta rename to Assets/GameMain/Scripts/UI/Base/IFormController.cs.meta diff --git a/Assets/GameMain/Scripts/UI/UGuiForm.cs b/Assets/GameMain/Scripts/UI/Base/UGuiForm.cs similarity index 100% rename from Assets/GameMain/Scripts/UI/UGuiForm.cs rename to Assets/GameMain/Scripts/UI/Base/UGuiForm.cs diff --git a/Assets/GameMain/Scripts/UI/UGuiForm.cs.meta b/Assets/GameMain/Scripts/UI/Base/UGuiForm.cs.meta similarity index 100% rename from Assets/GameMain/Scripts/UI/UGuiForm.cs.meta rename to Assets/GameMain/Scripts/UI/Base/UGuiForm.cs.meta diff --git a/Assets/GameMain/Scripts/UI/UIContext.cs b/Assets/GameMain/Scripts/UI/Base/UIContext.cs similarity index 100% rename from Assets/GameMain/Scripts/UI/UIContext.cs rename to Assets/GameMain/Scripts/UI/Base/UIContext.cs diff --git a/Assets/GameMain/Scripts/UI/UIContext.cs.meta b/Assets/GameMain/Scripts/UI/Base/UIContext.cs.meta similarity index 100% rename from Assets/GameMain/Scripts/UI/UIContext.cs.meta rename to Assets/GameMain/Scripts/UI/Base/UIContext.cs.meta diff --git a/Assets/GameMain/Scripts/UI/GameplayA.meta b/Assets/GameMain/Scripts/UI/Combine.meta similarity index 100% rename from Assets/GameMain/Scripts/UI/GameplayA.meta rename to Assets/GameMain/Scripts/UI/Combine.meta diff --git a/Assets/GameMain/Scripts/UI/GameplayA/Context.meta b/Assets/GameMain/Scripts/UI/Combine/Context.meta similarity index 100% rename from Assets/GameMain/Scripts/UI/GameplayA/Context.meta rename to Assets/GameMain/Scripts/UI/Combine/Context.meta diff --git a/Assets/GameMain/Scripts/UI/GameplayA/Context/CombineFormContext.cs b/Assets/GameMain/Scripts/UI/Combine/Context/CombineFormContext.cs similarity index 100% rename from Assets/GameMain/Scripts/UI/GameplayA/Context/CombineFormContext.cs rename to Assets/GameMain/Scripts/UI/Combine/Context/CombineFormContext.cs diff --git a/Assets/GameMain/Scripts/UI/GameplayA/Context/CombineFormContext.cs.meta b/Assets/GameMain/Scripts/UI/Combine/Context/CombineFormContext.cs.meta similarity index 100% rename from Assets/GameMain/Scripts/UI/GameplayA/Context/CombineFormContext.cs.meta rename to Assets/GameMain/Scripts/UI/Combine/Context/CombineFormContext.cs.meta diff --git a/Assets/GameMain/Scripts/UI/GameplayA/Context/CombinePartContext.cs b/Assets/GameMain/Scripts/UI/Combine/Context/CombinePartContext.cs similarity index 100% rename from Assets/GameMain/Scripts/UI/GameplayA/Context/CombinePartContext.cs rename to Assets/GameMain/Scripts/UI/Combine/Context/CombinePartContext.cs diff --git a/Assets/GameMain/Scripts/UI/GameplayA/Context/CombinePartContext.cs.meta b/Assets/GameMain/Scripts/UI/Combine/Context/CombinePartContext.cs.meta similarity index 100% rename from Assets/GameMain/Scripts/UI/GameplayA/Context/CombinePartContext.cs.meta rename to Assets/GameMain/Scripts/UI/Combine/Context/CombinePartContext.cs.meta diff --git a/Assets/GameMain/Scripts/UI/GameplayA/Context/CombineSlotContext.cs b/Assets/GameMain/Scripts/UI/Combine/Context/CombineSlotContext.cs similarity index 100% rename from Assets/GameMain/Scripts/UI/GameplayA/Context/CombineSlotContext.cs rename to Assets/GameMain/Scripts/UI/Combine/Context/CombineSlotContext.cs diff --git a/Assets/GameMain/Scripts/UI/GameplayA/Context/CombineSlotContext.cs.meta b/Assets/GameMain/Scripts/UI/Combine/Context/CombineSlotContext.cs.meta similarity index 100% rename from Assets/GameMain/Scripts/UI/GameplayA/Context/CombineSlotContext.cs.meta rename to Assets/GameMain/Scripts/UI/Combine/Context/CombineSlotContext.cs.meta diff --git a/Assets/GameMain/Scripts/UI/GameplayA/Controller.meta b/Assets/GameMain/Scripts/UI/Combine/Controller.meta similarity index 100% rename from Assets/GameMain/Scripts/UI/GameplayA/Controller.meta rename to Assets/GameMain/Scripts/UI/Combine/Controller.meta diff --git a/Assets/GameMain/Scripts/UI/GameplayA/Controller/CombineFormController.cs b/Assets/GameMain/Scripts/UI/Combine/Controller/CombineFormController.cs similarity index 100% rename from Assets/GameMain/Scripts/UI/GameplayA/Controller/CombineFormController.cs rename to Assets/GameMain/Scripts/UI/Combine/Controller/CombineFormController.cs diff --git a/Assets/GameMain/Scripts/UI/GameplayA/Controller/CombineFormController.cs.meta b/Assets/GameMain/Scripts/UI/Combine/Controller/CombineFormController.cs.meta similarity index 100% rename from Assets/GameMain/Scripts/UI/GameplayA/Controller/CombineFormController.cs.meta rename to Assets/GameMain/Scripts/UI/Combine/Controller/CombineFormController.cs.meta diff --git a/Assets/GameMain/Scripts/UI/GameplayA/View.meta b/Assets/GameMain/Scripts/UI/Combine/View.meta similarity index 100% rename from Assets/GameMain/Scripts/UI/GameplayA/View.meta rename to Assets/GameMain/Scripts/UI/Combine/View.meta diff --git a/Assets/GameMain/Scripts/UI/GameplayA/View/CombineDraggablePart.cs b/Assets/GameMain/Scripts/UI/Combine/View/CombineDraggablePart.cs similarity index 99% rename from Assets/GameMain/Scripts/UI/GameplayA/View/CombineDraggablePart.cs rename to Assets/GameMain/Scripts/UI/Combine/View/CombineDraggablePart.cs index 746a1ee..e5a5571 100644 --- a/Assets/GameMain/Scripts/UI/GameplayA/View/CombineDraggablePart.cs +++ b/Assets/GameMain/Scripts/UI/Combine/View/CombineDraggablePart.cs @@ -340,7 +340,7 @@ namespace UI .SetUpdate(true); } - private void ReturnToSpawnAnimated() + public void ReturnToSpawnAnimated() { if (_spawnParent == null) { diff --git a/Assets/GameMain/Scripts/UI/GameplayA/View/CombineDraggablePart.cs.meta b/Assets/GameMain/Scripts/UI/Combine/View/CombineDraggablePart.cs.meta similarity index 100% rename from Assets/GameMain/Scripts/UI/GameplayA/View/CombineDraggablePart.cs.meta rename to Assets/GameMain/Scripts/UI/Combine/View/CombineDraggablePart.cs.meta diff --git a/Assets/GameMain/Scripts/UI/GameplayA/View/CombineForm.cs b/Assets/GameMain/Scripts/UI/Combine/View/CombineForm.cs similarity index 100% rename from Assets/GameMain/Scripts/UI/GameplayA/View/CombineForm.cs rename to Assets/GameMain/Scripts/UI/Combine/View/CombineForm.cs diff --git a/Assets/GameMain/Scripts/UI/GameplayA/View/CombineForm.cs.meta b/Assets/GameMain/Scripts/UI/Combine/View/CombineForm.cs.meta similarity index 100% rename from Assets/GameMain/Scripts/UI/GameplayA/View/CombineForm.cs.meta rename to Assets/GameMain/Scripts/UI/Combine/View/CombineForm.cs.meta diff --git a/Assets/GameMain/Scripts/UI/GameplayA/View/CombineSlot.cs b/Assets/GameMain/Scripts/UI/Combine/View/CombineSlot.cs similarity index 100% rename from Assets/GameMain/Scripts/UI/GameplayA/View/CombineSlot.cs rename to Assets/GameMain/Scripts/UI/Combine/View/CombineSlot.cs diff --git a/Assets/GameMain/Scripts/UI/GameplayA/View/CombineSlot.cs.meta b/Assets/GameMain/Scripts/UI/Combine/View/CombineSlot.cs.meta similarity index 100% rename from Assets/GameMain/Scripts/UI/GameplayA/View/CombineSlot.cs.meta rename to Assets/GameMain/Scripts/UI/Combine/View/CombineSlot.cs.meta diff --git a/Assets/GameMain/Scripts/UI/Dialog.meta b/Assets/GameMain/Scripts/UI/Dialog.meta new file mode 100644 index 0000000..567372b --- /dev/null +++ b/Assets/GameMain/Scripts/UI/Dialog.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: d81d2a322c2e93948b4d5aa7e36c99f2 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/GameMain/Scripts/UI/Dialog/Context.meta b/Assets/GameMain/Scripts/UI/Dialog/Context.meta new file mode 100644 index 0000000..7b46b65 --- /dev/null +++ b/Assets/GameMain/Scripts/UI/Dialog/Context.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: ae5528a06773f5a45b75a99f619c2e22 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/GameMain/Scripts/UI/Dialog/Context/DialogFormContext.cs b/Assets/GameMain/Scripts/UI/Dialog/Context/DialogFormContext.cs new file mode 100644 index 0000000..46ec048 --- /dev/null +++ b/Assets/GameMain/Scripts/UI/Dialog/Context/DialogFormContext.cs @@ -0,0 +1,26 @@ +using Definition.Enum; + +namespace UI +{ + public class DialogFormContext : UIContext + { + public float PlayingSpeed = 1f; + + public int ChapterId = 0; + public int DialogId = 0; + public string DialogTitle = string.Empty; + public DialogFormMode DialogUIMode = DialogFormMode.None; + + public int CurrentLineId = 0; + public string SpeakerId = string.Empty; + public string SpeakerName = string.Empty; + public ExpressionType Expression = ExpressionType.None; + public int Direction = 0; + public string Text = string.Empty; + public EmphasisType Emphasis = EmphasisType.None; + + public int LineIndex = -1; + public int TotalLines = 0; + public bool IsLastLine = false; + } +} diff --git a/Assets/GameMain/Scripts/UI/Dialog/Context/DialogFormContext.cs.meta b/Assets/GameMain/Scripts/UI/Dialog/Context/DialogFormContext.cs.meta new file mode 100644 index 0000000..3610a60 --- /dev/null +++ b/Assets/GameMain/Scripts/UI/Dialog/Context/DialogFormContext.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 38341401b5804de47bb0a9a1c79d20d8 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/GameMain/Scripts/UI/Dialog/Controller.meta b/Assets/GameMain/Scripts/UI/Dialog/Controller.meta new file mode 100644 index 0000000..5d8ca16 --- /dev/null +++ b/Assets/GameMain/Scripts/UI/Dialog/Controller.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 3c721a41db518484e9a1771952725489 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/GameMain/Scripts/UI/Dialog/Controller/DialogFormController.cs b/Assets/GameMain/Scripts/UI/Dialog/Controller/DialogFormController.cs new file mode 100644 index 0000000..5a3014b --- /dev/null +++ b/Assets/GameMain/Scripts/UI/Dialog/Controller/DialogFormController.cs @@ -0,0 +1,168 @@ +using System; +using Definition.Enum; +using GameFramework.Event; +using UnityGameFramework.Runtime; + +namespace UI +{ + public class DialogFormController : IFormController + { + private DialogFormContext _context; + private DialogFormBase _dialogForm; + private int? _formSerialId; + private bool _pendingRefresh; + + public DialogFormController() + { + GameEntry.Event.Subscribe(OpenUIFormSuccessEventArgs.EventId, OnOpenUIFormSuccess); + GameEntry.Event.Subscribe(CloseUIFormCompleteEventArgs.EventId, OnCloseUIFormComplete); + } + + public int? OpenUI(DialogFormContext context) + { + if (context == null) + { + Log.Warning("DialogFormController open failed. context is null."); + return null; + } + + _context = context; + + UIFormId targetFormId = MapDialogFormId(context.DialogUIMode); + if (targetFormId == UIFormId.Undefined) + { + Log.Warning("DialogFormController open failed. Unsupported mode '{0}'.", context.DialogUIMode.ToString()); + return null; + } + + if (_dialogForm != null && _dialogForm.UIMode == context.DialogUIMode) + { + _dialogForm.StartDialog(context); + return _formSerialId; + } + + CloseUI(); + _pendingRefresh = true; + _formSerialId = GameEntry.UI.OpenUIForm(targetFormId, context); + return _formSerialId; + } + + public void CloseUI() + { + _pendingRefresh = false; + + if (_formSerialId.HasValue) + { + GameEntry.UI.CloseUIForm(_formSerialId.Value); + return; + } + + if (_dialogForm != null) + { + _dialogForm.Close(); + } + } + + public void OnDialogStarted(DialogFormContext context) + { + _context = context; + TryRefreshUI(); + } + + public void OnDialogLineChanged(DialogFormContext context) + { + _context = context; + TryRefreshUI(); + } + + public void OnDialogEnded(DialogFormContext context) + { + _context = context; + } + + ~DialogFormController() + { + GameEntry.Event.Unsubscribe(OpenUIFormSuccessEventArgs.EventId, OnOpenUIFormSuccess); + GameEntry.Event.Unsubscribe(CloseUIFormCompleteEventArgs.EventId, OnCloseUIFormComplete); + } + + private void TryRefreshUI() + { + if (_context == null) + { + return; + } + + if (_dialogForm == null) + { + _pendingRefresh = true; + return; + } + + _dialogForm.StartDialog(_context); + _pendingRefresh = false; + } + + private static UIFormId MapDialogFormId(DialogFormMode mode) + { + switch (mode) + { + case DialogFormMode.Mask: + return UIFormId.MaskDialogForm; + case DialogFormMode.BottomBox: + return UIFormId.BottomBoxDialogForm; + case DialogFormMode.Bubble: + throw new NotImplementedException("BubbleBox 对话框尚未实现"); + default: + return UIFormId.Undefined; + } + } + + private void OnOpenUIFormSuccess(object sender, GameEventArgs e) + { + if (!(e is OpenUIFormSuccessEventArgs args)) + { + return; + } + + if (!_formSerialId.HasValue) + { + return; + } + + if (args.UIForm == null || args.UIForm.SerialId != _formSerialId.Value || args.UserData != _context) + { + return; + } + + _dialogForm = args.UIForm.Logic as DialogFormBase; + if (_dialogForm == null) + { + Log.Warning("DialogFormController open success but form logic is invalid."); + return; + } + + if (_pendingRefresh) + { + TryRefreshUI(); + } + } + + private void OnCloseUIFormComplete(object sender, GameEventArgs e) + { + if (!(e is CloseUIFormCompleteEventArgs args)) + { + return; + } + + if (args.SerialId != _formSerialId) + { + return; + } + + _dialogForm = null; + _formSerialId = null; + _pendingRefresh = false; + } + } +} diff --git a/Assets/GameMain/Scripts/UI/Dialog/Controller/DialogFormController.cs.meta b/Assets/GameMain/Scripts/UI/Dialog/Controller/DialogFormController.cs.meta new file mode 100644 index 0000000..dcfffc7 --- /dev/null +++ b/Assets/GameMain/Scripts/UI/Dialog/Controller/DialogFormController.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 52cc4e85f8030334689fdcff90748161 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/GameMain/Scripts/UI/Dialog/View.meta b/Assets/GameMain/Scripts/UI/Dialog/View.meta new file mode 100644 index 0000000..87409a9 --- /dev/null +++ b/Assets/GameMain/Scripts/UI/Dialog/View.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: c4b7102b2e334264398178de3d6325b4 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/GameMain/Scripts/UI/Dialog/View/BottomDialogForm.cs b/Assets/GameMain/Scripts/UI/Dialog/View/BottomDialogForm.cs new file mode 100644 index 0000000..72128ae --- /dev/null +++ b/Assets/GameMain/Scripts/UI/Dialog/View/BottomDialogForm.cs @@ -0,0 +1,280 @@ +using DG.Tweening; +using Definition.Enum; +using TMPro; +using UnityEngine; +using UnityEngine.UI; +using UnityGameFramework.Runtime; + +namespace UI +{ + public class BottomDialogForm : DialogFormBase + { + public override DialogFormMode UIMode => DialogFormMode.BottomBox; + + [SerializeField] private GameObject _speakerArea; + + [SerializeField] private TMP_Text _speakerNameText; + + [SerializeField] private TMP_Text _contentText; + + [SerializeField] private Image _leftSprite; + + [SerializeField] private Image _rightSprite; + + [SerializeField] private int _leftSpritePosition = 450; + + [SerializeField] private int _rightSpritePosition = -450; + + [SerializeField] private float _moveDuration = 0.25f; + + [SerializeField] private Ease _moveEase = Ease.OutCubic; + + private readonly int _singleSpeakerCenterPosition = Screen.width / 2; + + private string _leftSpeakerToken = string.Empty; + private string _rightSpeakerToken = string.Empty; + private Sequence _layoutSequence; + + public override void StartDialog(DialogFormContext context) + { + if (context == null) + { + Log.Warning("BottomDialogForm start failed. context is null."); + return; + } + + _context = context; + + string speakerName = context.SpeakerName; + + if (_speakerArea != null) + { + _speakerArea.SetActive(!string.IsNullOrEmpty(speakerName)); + } + + if (_speakerNameText != null) + { + _speakerNameText.text = speakerName; + } + + PlayTypewriter(_contentText, context.Text, context.PlayingSpeed); + + if (string.IsNullOrEmpty(speakerName)) + { + ClearSpeakerState(); + ApplySpeakerLayout(false, false, true); + return; + } + + bool isRightSpeaker = context.Direction > 0; + if (isRightSpeaker) + { + _rightSpeakerToken = speakerName; + } + else + { + _leftSpeakerToken = speakerName; + } + + bool hasLeftSpeaker = !string.IsNullOrEmpty(_leftSpeakerToken); + bool hasRightSpeaker = !string.IsNullOrEmpty(_rightSpeakerToken); + ApplySpeakerLayout(hasLeftSpeaker, hasRightSpeaker, false); + } + + protected override void OnClose(bool isShutdown, object userData) + { + ClearSpeakerState(); + KillLayoutTween(); + ApplySpeakerLayout(false, false, true); + base.OnClose(isShutdown, userData); + } + + private void ClearSpeakerState() + { + _leftSpeakerToken = string.Empty; + _rightSpeakerToken = string.Empty; + } + + private void KillLayoutTween() + { + if (_layoutSequence != null) + { + _layoutSequence.Kill(); + _layoutSequence = null; + } + } + + private void ApplySpeakerLayout(bool hasLeftSpeaker, bool hasRightSpeaker, bool instant) + { + if (_leftSprite == null || _rightSprite == null) + { + return; + } + + bool leftCurrentlyVisible = _leftSprite.gameObject.activeSelf; + bool rightCurrentlyVisible = _rightSprite.gameObject.activeSelf; + + bool leftTargetVisible = hasLeftSpeaker; + bool rightTargetVisible = hasRightSpeaker; + + float leftTargetX = GetTargetX(true, hasLeftSpeaker, hasRightSpeaker); + float rightTargetX = GetTargetX(false, hasLeftSpeaker, hasRightSpeaker); + + KillLayoutTween(); + + PrepareStartState( + leftCurrentlyVisible, + rightCurrentlyVisible, + leftTargetVisible, + rightTargetVisible, + hasLeftSpeaker, + hasRightSpeaker); + + if (instant || _moveDuration <= 0f) + { + SetSpritePosition(_leftSprite.rectTransform, leftTargetX); + SetSpritePosition(_rightSprite.rectTransform, rightTargetX); + SetSpriteVisible(_leftSprite, leftTargetVisible); + SetSpriteVisible(_rightSprite, rightTargetVisible); + return; + } + + _layoutSequence = DOTween.Sequence(); + + Tween leftTween = CreateMoveTween(_leftSprite.rectTransform, leftTargetX); + if (leftTween != null) + { + _layoutSequence.Join(leftTween); + } + + Tween rightTween = CreateMoveTween(_rightSprite.rectTransform, rightTargetX); + if (rightTween != null) + { + _layoutSequence.Join(rightTween); + } + + if (_layoutSequence.active && _layoutSequence.Duration(false) > 0f) + { + _layoutSequence.OnComplete(() => + { + SetSpriteVisible(_leftSprite, leftTargetVisible); + SetSpriteVisible(_rightSprite, rightTargetVisible); + _layoutSequence = null; + }); + } + else + { + SetSpritePosition(_leftSprite.rectTransform, leftTargetX); + SetSpritePosition(_rightSprite.rectTransform, rightTargetX); + SetSpriteVisible(_leftSprite, leftTargetVisible); + SetSpriteVisible(_rightSprite, rightTargetVisible); + _layoutSequence.Kill(); + _layoutSequence = null; + } + } + + private void PrepareStartState( + bool leftCurrentlyVisible, + bool rightCurrentlyVisible, + bool leftTargetVisible, + bool rightTargetVisible, + bool hasLeftSpeaker, + bool hasRightSpeaker) + { + if (leftTargetVisible && !leftCurrentlyVisible) + { + float leftStartX = GetAppearStartX(true, rightCurrentlyVisible, hasLeftSpeaker, hasRightSpeaker); + SetSpritePosition(_leftSprite.rectTransform, leftStartX); + SetSpriteVisible(_leftSprite, true); + } + + if (rightTargetVisible && !rightCurrentlyVisible) + { + float rightStartX = GetAppearStartX(false, leftCurrentlyVisible, hasLeftSpeaker, hasRightSpeaker); + SetSpritePosition(_rightSprite.rectTransform, rightStartX); + SetSpriteVisible(_rightSprite, true); + } + + if (leftCurrentlyVisible && !leftTargetVisible) + { + SetSpriteVisible(_leftSprite, true); + } + + if (rightCurrentlyVisible && !rightTargetVisible) + { + SetSpriteVisible(_rightSprite, true); + } + } + + private float GetAppearStartX(bool isLeft, bool otherCurrentlyVisible, bool hasLeftSpeaker, + bool hasRightSpeaker) + { + if (hasLeftSpeaker && hasRightSpeaker) + { + // single -> multi: hidden side starts from center, then both move to side positions. + if (otherCurrentlyVisible) + { + return _singleSpeakerCenterPosition; + } + + return isLeft ? _leftSpritePosition : _rightSpritePosition; + } + + // single appears: active side starts from its side and moves to center. + return isLeft ? _leftSpritePosition : _rightSpritePosition; + } + + private float GetTargetX(bool isLeft, bool hasLeftSpeaker, bool hasRightSpeaker) + { + if (hasLeftSpeaker && hasRightSpeaker) + { + return isLeft ? _leftSpritePosition : _rightSpritePosition; + } + + if (hasLeftSpeaker || hasRightSpeaker) + { + // multi -> single: both move to center first, then inactive side hides. + return _singleSpeakerCenterPosition; + } + + return isLeft ? _leftSpritePosition : _rightSpritePosition; + } + + private Tween CreateMoveTween(RectTransform rectTransform, float targetX) + { + if (rectTransform == null) + { + return null; + } + + if (Mathf.Abs(rectTransform.anchoredPosition.x - targetX) < 0.01f) + { + return null; + } + + return rectTransform.DOAnchorPosX(targetX, _moveDuration).SetEase(_moveEase); + } + + private static void SetSpriteVisible(Image spriteImage, bool visible) + { + if (spriteImage == null) + { + return; + } + + spriteImage.gameObject.SetActive(visible); + } + + private static void SetSpritePosition(RectTransform rectTransform, float xPosition) + { + if (rectTransform == null) + { + return; + } + + Vector2 anchoredPosition = rectTransform.anchoredPosition; + anchoredPosition.x = xPosition; + rectTransform.anchoredPosition = anchoredPosition; + } + } +} diff --git a/Assets/GameMain/Scripts/UI/Dialog/View/BottomDialogForm.cs.meta b/Assets/GameMain/Scripts/UI/Dialog/View/BottomDialogForm.cs.meta new file mode 100644 index 0000000..6a7766b --- /dev/null +++ b/Assets/GameMain/Scripts/UI/Dialog/View/BottomDialogForm.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: ea6f55294a4cd2946a83649e7be82314 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/GameMain/Scripts/UI/Dialog/View/DialogFormBase.cs b/Assets/GameMain/Scripts/UI/Dialog/View/DialogFormBase.cs new file mode 100644 index 0000000..6d35785 --- /dev/null +++ b/Assets/GameMain/Scripts/UI/Dialog/View/DialogFormBase.cs @@ -0,0 +1,146 @@ +using System.Collections; +using Definition.Enum; +using Event; +using TMPro; +using UnityEngine; + +namespace UI +{ + public abstract class DialogFormBase : UGuiForm + { + protected DialogFormContext _context; + private Coroutine _typingCoroutine; + private TMP_Text _typingTargetText; + private bool _isTypewriting; + + public abstract DialogFormMode UIMode { get; } + + public abstract void StartDialog(DialogFormContext context); + + protected override void OnOpen(object userData) + { + base.OnOpen(userData); + + if (!(userData is DialogFormContext context)) + { + return; + } + + _context = context; + StartDialog(context); + } + + protected override void OnClose(bool isShutdown, object userData) + { + StopTypewriter(); + _context = null; + base.OnClose(isShutdown, userData); + } + + public void OnClickNextLine() + { + if (CompleteTypewriterIfRunning()) + { + return; + } + + GameEntry.Event.Fire(this, DialogNextLineRequestEventArgs.Create()); + } + + public void OnClickSkipDialog() + { + GameEntry.Event.Fire(this, DialogSkipRequestEventArgs.Create()); + } + + public void OnClickStopDialog() + { + GameEntry.Event.Fire(this, DialogStopRequestEventArgs.Create()); + } + + protected void PlayTypewriter(TMP_Text targetText, string text, float charsPerSecond) + { + StopTypewriter(); + + if (targetText == null) + { + return; + } + + string finalText = text ?? string.Empty; + _typingTargetText = targetText; + + if (charsPerSecond <= 0f || string.IsNullOrEmpty(finalText)) + { + targetText.text = finalText; + targetText.maxVisibleCharacters = int.MaxValue; + _isTypewriting = false; + return; + } + + _isTypewriting = true; + _typingCoroutine = StartCoroutine(TypewriterRoutine(targetText, finalText, charsPerSecond)); + } + + protected void StopTypewriter() + { + if (_typingCoroutine != null) + { + StopCoroutine(_typingCoroutine); + _typingCoroutine = null; + } + + _typingTargetText = null; + _isTypewriting = false; + } + + private bool CompleteTypewriterIfRunning() + { + if (!_isTypewriting || _typingTargetText == null) + { + return false; + } + + _typingTargetText.maxVisibleCharacters = int.MaxValue; + StopTypewriter(); + return true; + } + + private IEnumerator TypewriterRoutine(TMP_Text targetText, string finalText, float charsPerSecond) + { + targetText.text = finalText; + targetText.ForceMeshUpdate(); + + int totalCharacters = targetText.textInfo.characterCount; + if (totalCharacters <= 0) + { + targetText.maxVisibleCharacters = int.MaxValue; + _typingCoroutine = null; + _typingTargetText = null; + _isTypewriting = false; + yield break; + } + + targetText.maxVisibleCharacters = 0; + float elapsed = 0f; + int visibleCharacters = 0; + + while (visibleCharacters < totalCharacters) + { + elapsed += Time.unscaledDeltaTime; + int nextVisible = Mathf.Min(totalCharacters, Mathf.FloorToInt(elapsed * charsPerSecond)); + if (nextVisible != visibleCharacters) + { + visibleCharacters = nextVisible; + targetText.maxVisibleCharacters = visibleCharacters; + } + + yield return null; + } + + targetText.maxVisibleCharacters = int.MaxValue; + _typingCoroutine = null; + _typingTargetText = null; + _isTypewriting = false; + } + } +} diff --git a/Assets/GameMain/Scripts/UI/Dialog/View/DialogFormBase.cs.meta b/Assets/GameMain/Scripts/UI/Dialog/View/DialogFormBase.cs.meta new file mode 100644 index 0000000..bb6d8d5 --- /dev/null +++ b/Assets/GameMain/Scripts/UI/Dialog/View/DialogFormBase.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: aafc42873758b514282b3a75e3ba4665 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/GameMain/Scripts/UI/Dialog/View/MaskDialogForm.cs b/Assets/GameMain/Scripts/UI/Dialog/View/MaskDialogForm.cs new file mode 100644 index 0000000..0673233 --- /dev/null +++ b/Assets/GameMain/Scripts/UI/Dialog/View/MaskDialogForm.cs @@ -0,0 +1,35 @@ +using Definition.Enum; +using TMPro; +using UnityEngine; +using UnityEngine.UI; +using UnityGameFramework.Runtime; + +namespace UI +{ + public class MaskDialogForm : DialogFormBase + { + public override DialogFormMode UIMode => DialogFormMode.Mask; + + [SerializeField] private Image _maskImage; + + [SerializeField] private TMP_Text _text; + + public override void StartDialog(DialogFormContext context) + { + if (context == null) + { + Log.Warning("MaskDialogForm start failed. context is null."); + return; + } + + _context = context; + + if (_maskImage != null) + { + _maskImage.gameObject.SetActive(true); + } + + PlayTypewriter(_text, context.Text, context.PlayingSpeed); + } + } +} diff --git a/Assets/GameMain/Scripts/UI/Dialog/View/MaskDialogForm.cs.meta b/Assets/GameMain/Scripts/UI/Dialog/View/MaskDialogForm.cs.meta new file mode 100644 index 0000000..d4586ae --- /dev/null +++ b/Assets/GameMain/Scripts/UI/Dialog/View/MaskDialogForm.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 5a63462640e70af40972b9841beafe6c +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/GameMain/Scripts/UI/UIExtension.cs b/Assets/GameMain/Scripts/UI/UIExtension.cs index 3b6d6b8..795c8d9 100644 --- a/Assets/GameMain/Scripts/UI/UIExtension.cs +++ b/Assets/GameMain/Scripts/UI/UIExtension.cs @@ -1,13 +1,9 @@ -//------------------------------------------------------------ -// Game Framework -// Copyright © 2013-2021 Jiang Yin. All rights reserved. -// Homepage: https://gameframework.cn/ -// Feedback: mailto:ellan@gameframework.cn -//------------------------------------------------------------ - -using GameFramework.DataTable; +using GameFramework.DataTable; using GameFramework.UI; using System.Collections; +using CustomUtility; +using DataTable; +using Definition; using Procedure; using StarForce; using UnityEngine; diff --git a/Assets/GameMain/Scripts/Utility/AssetUtility.cs b/Assets/GameMain/Scripts/Utility/AssetUtility.cs index 5557d0c..f41d109 100644 --- a/Assets/GameMain/Scripts/Utility/AssetUtility.cs +++ b/Assets/GameMain/Scripts/Utility/AssetUtility.cs @@ -7,7 +7,7 @@ using GameFramework; -namespace StarForce +namespace CustomUtility { public static class AssetUtility { @@ -65,5 +65,10 @@ namespace StarForce { return Utility.Text.Format("Assets/GameMain/UI/UISounds/{0}.wav", assetName); } + + public static string GetUIDialogAsset(string assetName) + { + return Utility.Text.Format("Assets/GameMain/UI/Dialogs/{0}.prefab", assetName); + } } } diff --git a/Assets/GameMain/Scripts/Utility/EnumUtility.cs b/Assets/GameMain/Scripts/Utility/EnumUtility.cs new file mode 100644 index 0000000..83de003 --- /dev/null +++ b/Assets/GameMain/Scripts/Utility/EnumUtility.cs @@ -0,0 +1,27 @@ +using System.Collections.Generic; +using UnityGameFramework.Runtime; + +namespace CustomUtility +{ + public static class EnumUtility where T : struct, System.Enum + { + private static readonly Dictionary _enumCache = new(); + + public static T Get(string value) + { + if (!_enumCache.TryGetValue(value, out T result)) + { + if (System.Enum.TryParse(value, true, out result)) + { + _enumCache[value] = result; + } + else + { + Log.Error($"Enum 解析失败:类型:{typeof(T).Name} 不包含值 {value}"); + } + } + + return result; + } + } +} diff --git a/Assets/GameMain/Scripts/Utility/EnumUtility.cs.meta b/Assets/GameMain/Scripts/Utility/EnumUtility.cs.meta new file mode 100644 index 0000000..6850aba --- /dev/null +++ b/Assets/GameMain/Scripts/Utility/EnumUtility.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: d0591e8f95955014f8c2f8d9ba3c9247 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/GameMain/Scripts/Utility/LitJsonHelper.cs b/Assets/GameMain/Scripts/Utility/LitJsonHelper.cs index 19a242e..f2d3f1e 100644 --- a/Assets/GameMain/Scripts/Utility/LitJsonHelper.cs +++ b/Assets/GameMain/Scripts/Utility/LitJsonHelper.cs @@ -9,7 +9,7 @@ using GameFramework; using LitJson; using System; -namespace StarForce +namespace CustomUtility { /// /// LitJSON 函数集辅助器。 diff --git a/Assets/GameMain/Scripts/Utility/WebUtility.cs b/Assets/GameMain/Scripts/Utility/WebUtility.cs index 8d5ceeb..f1c0fcf 100644 --- a/Assets/GameMain/Scripts/Utility/WebUtility.cs +++ b/Assets/GameMain/Scripts/Utility/WebUtility.cs @@ -1,13 +1,6 @@ -//------------------------------------------------------------ -// Game Framework -// Copyright © 2013-2021 Jiang Yin. All rights reserved. -// Homepage: https://gameframework.cn/ -// Feedback: mailto:ellan@gameframework.cn -//------------------------------------------------------------ +using System; -using System; - -namespace StarForce +namespace CustomUtility { public static class WebUtility { diff --git a/Assets/GameMain/UI/UIForms/BottomBoxDialogForm.prefab b/Assets/GameMain/UI/UIForms/BottomBoxDialogForm.prefab new file mode 100644 index 0000000..19efbf2 --- /dev/null +++ b/Assets/GameMain/UI/UIForms/BottomBoxDialogForm.prefab @@ -0,0 +1,937 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &577377382380353288 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 478704929657922221} + - component: {fileID: 3708131469420921886} + - component: {fileID: 1177229253130277070} + - component: {fileID: 8970091190510382761} + m_Layer: 5 + m_Name: NextLineButton + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &478704929657922221 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 577377382380353288} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 4703471767818675053} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &3708131469420921886 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 577377382380353288} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 0} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_Sprite: {fileID: 0} + m_Type: 0 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 + m_UseSpriteMesh: 0 + m_PixelsPerUnitMultiplier: 1 +--- !u!222 &1177229253130277070 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 577377382380353288} + m_CullTransparentMesh: 1 +--- !u!114 &8970091190510382761 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 577377382380353288} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 4e29b1a8efbd4b44bb3f3716e73f07ff, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Navigation: + m_Mode: 3 + m_WrapAround: 0 + m_SelectOnUp: {fileID: 0} + m_SelectOnDown: {fileID: 0} + m_SelectOnLeft: {fileID: 0} + m_SelectOnRight: {fileID: 0} + m_Transition: 0 + m_Colors: + m_NormalColor: {r: 1, g: 1, b: 1, a: 1} + m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} + m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1} + m_SelectedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} + m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608} + m_ColorMultiplier: 1 + m_FadeDuration: 0.1 + m_SpriteState: + m_HighlightedSprite: {fileID: 0} + m_PressedSprite: {fileID: 0} + m_SelectedSprite: {fileID: 0} + m_DisabledSprite: {fileID: 0} + m_AnimationTriggers: + m_NormalTrigger: Normal + m_HighlightedTrigger: Highlighted + m_PressedTrigger: Pressed + m_SelectedTrigger: Selected + m_DisabledTrigger: Disabled + m_Interactable: 1 + m_TargetGraphic: {fileID: 3708131469420921886} + m_OnClick: + m_PersistentCalls: + m_Calls: + - m_Target: {fileID: 2327325990879817607} + m_TargetAssemblyTypeName: UI.DialogFormBase, Assembly-CSharp + m_MethodName: OnClickNextLine + m_Mode: 1 + m_Arguments: + m_ObjectArgument: {fileID: 0} + m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine + m_IntArgument: 0 + m_FloatArgument: 0 + m_StringArgument: + m_BoolArgument: 0 + m_CallState: 2 +--- !u!1 &1001066407702705397 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 3708143324325626536} + - component: {fileID: 6873615243070434848} + - component: {fileID: 6431296888118130931} + m_Layer: 5 + m_Name: ContentText + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &3708143324325626536 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1001066407702705397} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 7192457896265437741} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: -200, y: -100} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!222 &6873615243070434848 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1001066407702705397} + m_CullTransparentMesh: 1 +--- !u!114 &6431296888118130931 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1001066407702705397} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: f4688fdb7df04437aeb418b961361dc5, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 0 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_text: "\u674E\u8BEB" + m_isRightToLeft: 0 + m_fontAsset: {fileID: 11400000, guid: 99d811b0183246646a2ce8df996f4bca, type: 2} + m_sharedMaterial: {fileID: -1106088975554028259, guid: 99d811b0183246646a2ce8df996f4bca, + type: 2} + m_fontSharedMaterials: [] + m_fontMaterial: {fileID: 0} + m_fontMaterials: [] + m_fontColor32: + serializedVersion: 2 + rgba: 4293980400 + m_fontColor: {r: 0.9411765, g: 0.9411765, b: 0.9411765, a: 1} + m_enableVertexGradient: 0 + m_colorMode: 3 + m_fontColorGradient: + topLeft: {r: 1, g: 1, b: 1, a: 1} + topRight: {r: 1, g: 1, b: 1, a: 1} + bottomLeft: {r: 1, g: 1, b: 1, a: 1} + bottomRight: {r: 1, g: 1, b: 1, a: 1} + m_fontColorGradientPreset: {fileID: 0} + m_spriteAsset: {fileID: 0} + m_tintAllSprites: 0 + m_StyleSheet: {fileID: 0} + m_TextStyleHashCode: -1183493901 + m_overrideHtmlColors: 0 + m_faceColor: + serializedVersion: 2 + rgba: 4294967295 + m_fontSize: 70 + m_fontSizeBase: 70 + m_fontWeight: 400 + m_enableAutoSizing: 0 + m_fontSizeMin: 18 + m_fontSizeMax: 72 + m_fontStyle: 0 + m_HorizontalAlignment: 1 + m_VerticalAlignment: 256 + m_textAlignment: 65535 + m_characterSpacing: 0 + m_wordSpacing: 0 + m_lineSpacing: 0 + m_lineSpacingMax: 0 + m_paragraphSpacing: 0 + m_charWidthMaxAdj: 0 + m_enableWordWrapping: 1 + m_wordWrappingRatios: 0.4 + m_overflowMode: 0 + m_linkedTextComponent: {fileID: 0} + parentLinkedComponent: {fileID: 0} + m_enableKerning: 1 + m_enableExtraPadding: 0 + checkPaddingRequired: 0 + m_isRichText: 1 + m_parseCtrlCharacters: 1 + m_isOrthographic: 1 + m_isCullingEnabled: 0 + m_horizontalMapping: 0 + m_verticalMapping: 0 + m_uvLineOffset: 0 + m_geometrySortingOrder: 0 + m_IsTextObjectScaleStatic: 0 + m_VertexBufferAutoSizeReduction: 0 + m_useMaxVisibleDescender: 1 + m_pageToDisplay: 1 + m_margin: {x: 0, y: 0, z: 0, w: 0} + m_isUsingLegacyAnimationComponent: 0 + m_isVolumetricText: 0 + m_hasFontAssetChanged: 0 + m_baseMaterial: {fileID: 0} + m_maskOffset: {x: 0, y: 0, z: 0, w: 0} +--- !u!1 &1966594047748998563 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 7192457896265437741} + m_Layer: 5 + m_Name: ContentArea + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &7192457896265437741 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1966594047748998563} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 8762364413705962150} + - {fileID: 3708143324325626536} + m_Father: {fileID: 2330152971407905255} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0, y: -50} + m_SizeDelta: {x: 0, y: -100} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!1 &2526382269717144677 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 4594737505273760298} + - component: {fileID: 1858592913377441272} + - component: {fileID: 7945103967507868302} + m_Layer: 5 + m_Name: LeftSpeaker + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 0 +--- !u!224 &4594737505273760298 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2526382269717144677} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 6089528910385973127} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0.5} + m_AnchorMax: {x: 0, y: 0.5} + m_AnchoredPosition: {x: 450, y: -200} + m_SizeDelta: {x: 900, y: 1205.4878} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!222 &1858592913377441272 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2526382269717144677} + m_CullTransparentMesh: 1 +--- !u!114 &7945103967507868302 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2526382269717144677} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 0 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_Sprite: {fileID: 0} + m_Type: 0 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 + m_UseSpriteMesh: 0 + m_PixelsPerUnitMultiplier: 1 +--- !u!1 &3736358320082617150 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 6089528910385973127} + m_Layer: 5 + m_Name: SpeakerArea + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &6089528910385973127 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3736358320082617150} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 4594737505273760298} + - {fileID: 1023330169278438415} + m_Father: {fileID: 4703471767818675053} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!1 &3752068138017298928 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1792700702723432816} + - component: {fileID: 6515285980419930672} + - component: {fileID: 8566667250576683572} + m_Layer: 5 + m_Name: bg + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &1792700702723432816 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3752068138017298928} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 5100528644975002445} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!222 &6515285980419930672 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3752068138017298928} + m_CullTransparentMesh: 1 +--- !u!114 &8566667250576683572 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3752068138017298928} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 0 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_Sprite: {fileID: 0} + m_Type: 0 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 + m_UseSpriteMesh: 0 + m_PixelsPerUnitMultiplier: 1 +--- !u!1 &4403804830056219076 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 5100528644975002445} + m_Layer: 5 + m_Name: NameArea + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &5100528644975002445 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4403804830056219076} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 1792700702723432816} + - {fileID: 8619101080858191825} + m_Father: {fileID: 2330152971407905255} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 1} + m_AnchorMax: {x: 0, y: 1} + m_AnchoredPosition: {x: 250, y: -50} + m_SizeDelta: {x: 500, y: 100} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!1 &4514918814497795030 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 8762364413705962150} + - component: {fileID: 2347793963973952820} + - component: {fileID: 7254061520918156868} + m_Layer: 5 + m_Name: bg + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &8762364413705962150 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4514918814497795030} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 7192457896265437741} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!222 &2347793963973952820 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4514918814497795030} + m_CullTransparentMesh: 1 +--- !u!114 &7254061520918156868 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4514918814497795030} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 0.39215687, g: 0.39215687, b: 0.39215687, a: 0.39215687} + m_RaycastTarget: 0 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_Sprite: {fileID: 0} + m_Type: 0 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 + m_UseSpriteMesh: 0 + m_PixelsPerUnitMultiplier: 1 +--- !u!1 &4995567450066526950 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 4703471767818675053} + - component: {fileID: 4643264964412212504} + - component: {fileID: 2327325990879817607} + m_Layer: 5 + m_Name: BottomBoxDialogForm + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &4703471767818675053 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4995567450066526950} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 6089528910385973127} + - {fileID: 2330152971407905255} + - {fileID: 478704929657922221} + m_Father: {fileID: 0} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!223 &4643264964412212504 +Canvas: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4995567450066526950} + m_Enabled: 1 + serializedVersion: 3 + m_RenderMode: 0 + m_Camera: {fileID: 0} + m_PlaneDistance: 100 + m_PixelPerfect: 0 + m_ReceivesEvents: 1 + m_OverrideSorting: 0 + m_OverridePixelPerfect: 0 + m_SortingBucketNormalizedSize: 0 + m_VertexColorAlwaysGammaSpace: 0 + m_AdditionalShaderChannelsFlag: 25 + m_UpdateRectTransformForStandalone: 0 + m_SortingLayerID: 0 + m_SortingOrder: 0 + m_TargetDisplay: 0 +--- !u!114 &2327325990879817607 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4995567450066526950} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: ea6f55294a4cd2946a83649e7be82314, type: 3} + m_Name: + m_EditorClassIdentifier: + _playSpeed: 0 + _speakerArea: {fileID: 3736358320082617150} + _speakerNameText: {fileID: 2470970474825277305} + _contentText: {fileID: 6431296888118130931} + _leftSprite: {fileID: 7945103967507868302} + _rightSprite: {fileID: 5385698520020721016} + _leftSpritePosition: 450 + _rightSpritePosition: -450 + _moveDuration: 0.25 + _moveEase: 9 +--- !u!1 &7381337123922490182 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 8619101080858191825} + - component: {fileID: 5148587339817138371} + - component: {fileID: 2470970474825277305} + m_Layer: 5 + m_Name: NameText + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &8619101080858191825 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7381337123922490182} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 5100528644975002445} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 100, y: 0} + m_SizeDelta: {x: -200, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!222 &5148587339817138371 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7381337123922490182} + m_CullTransparentMesh: 1 +--- !u!114 &2470970474825277305 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7381337123922490182} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: f4688fdb7df04437aeb418b961361dc5, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 0 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_text: "\u674E\u8BEB" + m_isRightToLeft: 0 + m_fontAsset: {fileID: 11400000, guid: 99d811b0183246646a2ce8df996f4bca, type: 2} + m_sharedMaterial: {fileID: -1106088975554028259, guid: 99d811b0183246646a2ce8df996f4bca, + type: 2} + m_fontSharedMaterials: [] + m_fontMaterial: {fileID: 0} + m_fontMaterials: [] + m_fontColor32: + serializedVersion: 2 + rgba: 4280163870 + m_fontColor: {r: 0.11764706, g: 0.11764706, b: 0.11764706, a: 1} + m_enableVertexGradient: 0 + m_colorMode: 3 + m_fontColorGradient: + topLeft: {r: 1, g: 1, b: 1, a: 1} + topRight: {r: 1, g: 1, b: 1, a: 1} + bottomLeft: {r: 1, g: 1, b: 1, a: 1} + bottomRight: {r: 1, g: 1, b: 1, a: 1} + m_fontColorGradientPreset: {fileID: 0} + m_spriteAsset: {fileID: 0} + m_tintAllSprites: 0 + m_StyleSheet: {fileID: 0} + m_TextStyleHashCode: -1183493901 + m_overrideHtmlColors: 0 + m_faceColor: + serializedVersion: 2 + rgba: 4294967295 + m_fontSize: 50 + m_fontSizeBase: 50 + m_fontWeight: 400 + m_enableAutoSizing: 0 + m_fontSizeMin: 18 + m_fontSizeMax: 72 + m_fontStyle: 0 + m_HorizontalAlignment: 2 + m_VerticalAlignment: 512 + m_textAlignment: 65535 + m_characterSpacing: 0 + m_wordSpacing: 0 + m_lineSpacing: 0 + m_lineSpacingMax: 0 + m_paragraphSpacing: 0 + m_charWidthMaxAdj: 0 + m_enableWordWrapping: 1 + m_wordWrappingRatios: 0.4 + m_overflowMode: 0 + m_linkedTextComponent: {fileID: 0} + parentLinkedComponent: {fileID: 0} + m_enableKerning: 1 + m_enableExtraPadding: 0 + checkPaddingRequired: 0 + m_isRichText: 1 + m_parseCtrlCharacters: 1 + m_isOrthographic: 1 + m_isCullingEnabled: 0 + m_horizontalMapping: 0 + m_verticalMapping: 0 + m_uvLineOffset: 0 + m_geometrySortingOrder: 0 + m_IsTextObjectScaleStatic: 0 + m_VertexBufferAutoSizeReduction: 0 + m_useMaxVisibleDescender: 1 + m_pageToDisplay: 1 + m_margin: {x: 0, y: 0, z: 0, w: 0} + m_isUsingLegacyAnimationComponent: 0 + m_isVolumetricText: 0 + m_hasFontAssetChanged: 0 + m_baseMaterial: {fileID: 0} + m_maskOffset: {x: 0, y: 0, z: 0, w: 0} +--- !u!1 &7436457223957886746 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1023330169278438415} + - component: {fileID: 23627497045646178} + - component: {fileID: 5385698520020721016} + m_Layer: 5 + m_Name: RightSpeaker + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 0 +--- !u!224 &1023330169278438415 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7436457223957886746} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 6089528910385973127} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 1, y: 0.5} + m_AnchorMax: {x: 1, y: 0.5} + m_AnchoredPosition: {x: -450, y: -200} + m_SizeDelta: {x: 900, y: 1205.4878} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!222 &23627497045646178 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7436457223957886746} + m_CullTransparentMesh: 1 +--- !u!114 &5385698520020721016 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7436457223957886746} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 0 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_Sprite: {fileID: 0} + m_Type: 0 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 + m_UseSpriteMesh: 0 + m_PixelsPerUnitMultiplier: 1 +--- !u!1 &7992201661324843749 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 2330152971407905255} + m_Layer: 5 + m_Name: DialogBox + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &2330152971407905255 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7992201661324843749} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 7192457896265437741} + - {fileID: 5100528644975002445} + m_Father: {fileID: 4703471767818675053} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 0} + m_AnchoredPosition: {x: 0, y: 300} + m_SizeDelta: {x: 0, y: 600} + m_Pivot: {x: 0.5, y: 0.5} diff --git a/Assets/GameMain/UI/UIForms/BottomBoxDialogForm.prefab.meta b/Assets/GameMain/UI/UIForms/BottomBoxDialogForm.prefab.meta new file mode 100644 index 0000000..81a89c4 --- /dev/null +++ b/Assets/GameMain/UI/UIForms/BottomBoxDialogForm.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 75da5a4ba56425747be081b9b396ba4e +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/GameMain/UI/UIForms/MaskDialogForm.prefab b/Assets/GameMain/UI/UIForms/MaskDialogForm.prefab new file mode 100644 index 0000000..fbe659d --- /dev/null +++ b/Assets/GameMain/UI/UIForms/MaskDialogForm.prefab @@ -0,0 +1,422 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &256497562328743555 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 7307862436028937289} + - component: {fileID: 5693490679758014302} + - component: {fileID: 3049537029752604282} + m_Layer: 5 + m_Name: Text + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &7307862436028937289 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 256497562328743555} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 6730913572669710148} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0.5, y: 0.5} + m_AnchorMax: {x: 0.5, y: 0.5} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 1600, y: 900} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!222 &5693490679758014302 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 256497562328743555} + m_CullTransparentMesh: 1 +--- !u!114 &3049537029752604282 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 256497562328743555} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: f4688fdb7df04437aeb418b961361dc5, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 0 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_text: "\u76F8\u4F20" + m_isRightToLeft: 0 + m_fontAsset: {fileID: 11400000, guid: 99d811b0183246646a2ce8df996f4bca, type: 2} + m_sharedMaterial: {fileID: -1106088975554028259, guid: 99d811b0183246646a2ce8df996f4bca, + type: 2} + m_fontSharedMaterials: [] + m_fontMaterial: {fileID: 0} + m_fontMaterials: [] + m_fontColor32: + serializedVersion: 2 + rgba: 4294967295 + m_fontColor: {r: 1, g: 1, b: 1, a: 1} + m_enableVertexGradient: 0 + m_colorMode: 3 + m_fontColorGradient: + topLeft: {r: 1, g: 1, b: 1, a: 1} + topRight: {r: 1, g: 1, b: 1, a: 1} + bottomLeft: {r: 1, g: 1, b: 1, a: 1} + bottomRight: {r: 1, g: 1, b: 1, a: 1} + m_fontColorGradientPreset: {fileID: 0} + m_spriteAsset: {fileID: 0} + m_tintAllSprites: 0 + m_StyleSheet: {fileID: 0} + m_TextStyleHashCode: -1183493901 + m_overrideHtmlColors: 0 + m_faceColor: + serializedVersion: 2 + rgba: 4294967295 + m_fontSize: 80 + m_fontSizeBase: 80 + m_fontWeight: 400 + m_enableAutoSizing: 0 + m_fontSizeMin: 18 + m_fontSizeMax: 72 + m_fontStyle: 0 + m_HorizontalAlignment: 2 + m_VerticalAlignment: 512 + m_textAlignment: 65535 + m_characterSpacing: 0 + m_wordSpacing: 0 + m_lineSpacing: 0 + m_lineSpacingMax: 0 + m_paragraphSpacing: 0 + m_charWidthMaxAdj: 0 + m_enableWordWrapping: 1 + m_wordWrappingRatios: 0.4 + m_overflowMode: 0 + m_linkedTextComponent: {fileID: 0} + parentLinkedComponent: {fileID: 0} + m_enableKerning: 1 + m_enableExtraPadding: 0 + checkPaddingRequired: 0 + m_isRichText: 1 + m_parseCtrlCharacters: 1 + m_isOrthographic: 1 + m_isCullingEnabled: 0 + m_horizontalMapping: 0 + m_verticalMapping: 0 + m_uvLineOffset: 0 + m_geometrySortingOrder: 0 + m_IsTextObjectScaleStatic: 0 + m_VertexBufferAutoSizeReduction: 0 + m_useMaxVisibleDescender: 1 + m_pageToDisplay: 1 + m_margin: {x: 0, y: 0, z: 0, w: 0} + m_isUsingLegacyAnimationComponent: 0 + m_isVolumetricText: 0 + m_hasFontAssetChanged: 0 + m_baseMaterial: {fileID: 0} + m_maskOffset: {x: 0, y: 0, z: 0, w: 0} +--- !u!1 &4692228887313498605 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 3823388611956485626} + - component: {fileID: 5658364238492869697} + - component: {fileID: 4516264451202920644} + - component: {fileID: 1141121294664198277} + m_Layer: 5 + m_Name: NextLineButton + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &3823388611956485626 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4692228887313498605} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 6730913572669710148} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &5658364238492869697 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4692228887313498605} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 0} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_Sprite: {fileID: 0} + m_Type: 0 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 + m_UseSpriteMesh: 0 + m_PixelsPerUnitMultiplier: 1 +--- !u!222 &4516264451202920644 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4692228887313498605} + m_CullTransparentMesh: 1 +--- !u!114 &1141121294664198277 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4692228887313498605} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 4e29b1a8efbd4b44bb3f3716e73f07ff, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Navigation: + m_Mode: 3 + m_WrapAround: 0 + m_SelectOnUp: {fileID: 0} + m_SelectOnDown: {fileID: 0} + m_SelectOnLeft: {fileID: 0} + m_SelectOnRight: {fileID: 0} + m_Transition: 0 + m_Colors: + m_NormalColor: {r: 1, g: 1, b: 1, a: 1} + m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} + m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1} + m_SelectedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} + m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608} + m_ColorMultiplier: 1 + m_FadeDuration: 0.1 + m_SpriteState: + m_HighlightedSprite: {fileID: 0} + m_PressedSprite: {fileID: 0} + m_SelectedSprite: {fileID: 0} + m_DisabledSprite: {fileID: 0} + m_AnimationTriggers: + m_NormalTrigger: Normal + m_HighlightedTrigger: Highlighted + m_PressedTrigger: Pressed + m_SelectedTrigger: Selected + m_DisabledTrigger: Disabled + m_Interactable: 1 + m_TargetGraphic: {fileID: 0} + m_OnClick: + m_PersistentCalls: + m_Calls: + - m_Target: {fileID: 440091646659500568} + m_TargetAssemblyTypeName: UI.DialogFormBase, Assembly-CSharp + m_MethodName: OnClickNextLine + m_Mode: 1 + m_Arguments: + m_ObjectArgument: {fileID: 0} + m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine + m_IntArgument: 0 + m_FloatArgument: 0 + m_StringArgument: + m_BoolArgument: 0 + m_CallState: 2 +--- !u!1 &5632933866905369215 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 4485858263841547480} + - component: {fileID: 5051123720036041340} + - component: {fileID: 5798302535966784477} + m_Layer: 5 + m_Name: Mask + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &4485858263841547480 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5632933866905369215} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 6730913572669710148} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!222 &5051123720036041340 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5632933866905369215} + m_CullTransparentMesh: 1 +--- !u!114 &5798302535966784477 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5632933866905369215} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 0, g: 0, b: 0, a: 1} + m_RaycastTarget: 0 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_Sprite: {fileID: 0} + m_Type: 0 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 + m_UseSpriteMesh: 0 + m_PixelsPerUnitMultiplier: 1 +--- !u!1 &5808177156550932694 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 6730913572669710148} + - component: {fileID: 440091646659500568} + - component: {fileID: 6496478377742295264} + m_Layer: 5 + m_Name: MaskDialogForm + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &6730913572669710148 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5808177156550932694} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 4485858263841547480} + - {fileID: 7307862436028937289} + - {fileID: 3823388611956485626} + m_Father: {fileID: 0} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &440091646659500568 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5808177156550932694} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 5a63462640e70af40972b9841beafe6c, type: 3} + m_Name: + m_EditorClassIdentifier: + _playSpeed: 0 + _maskImage: {fileID: 5798302535966784477} + _text: {fileID: 3049537029752604282} +--- !u!223 &6496478377742295264 +Canvas: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5808177156550932694} + m_Enabled: 1 + serializedVersion: 3 + m_RenderMode: 0 + m_Camera: {fileID: 0} + m_PlaneDistance: 100 + m_PixelPerfect: 0 + m_ReceivesEvents: 1 + m_OverrideSorting: 0 + m_OverridePixelPerfect: 0 + m_SortingBucketNormalizedSize: 0 + m_VertexColorAlwaysGammaSpace: 0 + m_AdditionalShaderChannelsFlag: 25 + m_UpdateRectTransformForStandalone: 0 + m_SortingLayerID: 0 + m_SortingOrder: 0 + m_TargetDisplay: 0 diff --git a/Assets/GameMain/UI/UIForms/MaskDialogForm.prefab.meta b/Assets/GameMain/UI/UIForms/MaskDialogForm.prefab.meta new file mode 100644 index 0000000..2c4ba5f --- /dev/null +++ b/Assets/GameMain/UI/UIForms/MaskDialogForm.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 59ac12de6091b7741bc2819cf790146f +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/GameMain/UI/UISprites/Dialog.meta b/Assets/GameMain/UI/UISprites/Dialog.meta new file mode 100644 index 0000000..9f76b90 --- /dev/null +++ b/Assets/GameMain/UI/UISprites/Dialog.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: ccd89cbb1579632438412d3b736e314a +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Launcher.unity b/Assets/Launcher.unity index 2d12a16..0e353b2 100644 --- a/Assets/Launcher.unity +++ b/Assets/Launcher.unity @@ -281,6 +281,7 @@ Transform: m_Children: - {fileID: 513208573} - {fileID: 1968988098} + - {fileID: 434859534} m_Father: {fileID: 1852670053} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &120093239 @@ -779,7 +780,7 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 11499388, guid: adb3eb1c35fcff14f89fba7b05c9d71c, type: 3} propertyPath: m_JsonHelperTypeName - value: StarForce.LitJsonHelper + value: CustomUtility.LitJsonHelper objectReference: {fileID: 0} m_RemovedComponents: [] m_RemovedGameObjects: [] @@ -796,6 +797,51 @@ Transform: type: 3} m_PrefabInstance: {fileID: 343730742} m_PrefabAsset: {fileID: 0} +--- !u!1 &434859533 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 434859534} + - component: {fileID: 434859535} + m_Layer: 0 + m_Name: Dialog + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &434859534 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 434859533} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 119167776} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &434859535 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 434859533} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: d6174838c30e460429e5628757bbf015, type: 3} + m_Name: + m_EditorClassIdentifier: + _playingSpeed: 10 --- !u!1 &513208572 GameObject: m_ObjectHideFlags: 0 @@ -1067,7 +1113,7 @@ GameObject: - component: {fileID: 1968988098} - component: {fileID: 1968988099} m_Layer: 0 - m_Name: GameplayAComponent + m_Name: Combine m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 @@ -1097,7 +1143,7 @@ MonoBehaviour: m_GameObject: {fileID: 1968988097} m_Enabled: 1 m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 0103c893efce444d9c6fe671306746fe, type: 3} + m_Script: {fileID: 11500000, guid: cc0388c578bec9746813380eee9038d4, type: 3} m_Name: m_EditorClassIdentifier: _autoCollectChildren: 1 diff --git a/ProjectSettings/ProjectSettings.asset b/ProjectSettings/ProjectSettings.asset index c2da562..403c004 100644 --- a/ProjectSettings/ProjectSettings.asset +++ b/ProjectSettings/ProjectSettings.asset @@ -812,11 +812,23 @@ PlayerSettings: webGLMemoryGeometricGrowthCap: 96 webGLPowerPreference: 2 scriptingDefineSymbols: - Android: ENABLE_DEBUG_AND_ABOVE_LOG - Standalone: ENABLE_DEBUG_AND_ABOVE_LOG - WebGL: ENABLE_DEBUG_AND_ABOVE_LOG - Windows Store Apps: ENABLE_DEBUG_AND_ABOVE_LOG - iPhone: ENABLE_DEBUG_AND_ABOVE_LOG + Android: ENABLE_DEBUG_AND_ABOVE_LOG;DOTWEEN + EmbeddedLinux: DOTWEEN + GameCoreScarlett: DOTWEEN + GameCoreXboxOne: DOTWEEN + LinuxHeadlessSimulation: DOTWEEN + Nintendo Switch: DOTWEEN + PS4: DOTWEEN + PS5: DOTWEEN + QNX: DOTWEEN + Stadia: DOTWEEN + Standalone: ENABLE_DEBUG_AND_ABOVE_LOG;DOTWEEN + VisionOS: DOTWEEN + WebGL: ENABLE_DEBUG_AND_ABOVE_LOG;DOTWEEN + Windows Store Apps: ENABLE_DEBUG_AND_ABOVE_LOG;DOTWEEN + XboxOne: DOTWEEN + iPhone: ENABLE_DEBUG_AND_ABOVE_LOG;DOTWEEN + tvOS: DOTWEEN additionalCompilerArguments: {} platformArchitecture: {} scriptingBackend: {} diff --git a/数据表/Dialog.txt b/数据表/Dialog.txt new file mode 100644 index 0000000..bb0b92c --- /dev/null +++ b/数据表/Dialog.txt @@ -0,0 +1,7 @@ +# 对话标识表 筛选用数据 +# Id Title UIMode ChapterId +# int string DialogUIMode int +# 对话编号 策划备注 对话标识 对话形式 章节编号 + 1001 第一章介绍 Chapter1_Intro Mask 1.001 + 1002 第一章主流程 Chapter1_Main BottomBox 1.002 + 1003 第一章玩法开始前闲聊 Chapter1_SmallTalk1 Bubble 1.003 diff --git a/数据表/Dialog.xlsx b/数据表/Dialog.xlsx new file mode 100644 index 0000000..7ad1427 Binary files /dev/null and b/数据表/Dialog.xlsx differ diff --git a/数据表/DialogLine.txt b/数据表/DialogLine.txt new file mode 100644 index 0000000..567ba54 --- /dev/null +++ b/数据表/DialogLine.txt @@ -0,0 +1,13 @@ +# 对话内容表 筛选用数据 +# Id SpeakerId Expression SpeakerName Direction Text Emphasis ChapterId DialogId +# int string ExpressionType string int string EmphasisType int int +# 对话行编号 策划备注 说话人Id 表情 显示人名 说话朝向 说话内容 演出效果 章节Id 对话Id + 100100001 Id规则为 Null None Null 0 相传。 None 1.00100001 1001.00001 + 100100002 第1位数为章节Id Null None Null 0 Mask。 None 1.00100002 1001.00002 + 100100003 第2-4位数为对话Id Null None Null 0 很好。 None 1.00100003 1001.00003 + 100200001 第5-9位数为对话行Id Xu Normal 徐晟壹 0 你好,王。 None 1.00200001 1002.00001 + 100200002 Wang Normal 王可嘉 1 你好,徐。 None 1.00200002 1002.00002 + 100200003 Master Normal 李诫 1 你们好。 None 1.00200003 1002.00003 + 100300001 Npc1 None Null 0 这人谁啊? None 1.00300001 1003.00001 + 100300002 Npc2 None Null 0 不知道啊? None 1.00300002 1003.00002 + 100300003 Npc1 None Null 0 不知道你在这干嘛。 None 1.00300003 1003.00003 diff --git a/数据表/DialogLine.xlsx b/数据表/DialogLine.xlsx new file mode 100644 index 0000000..e6680d4 Binary files /dev/null and b/数据表/DialogLine.xlsx differ diff --git a/数据表/Scene.txt b/数据表/Scene.txt index 29826e2..10e008e 100644 --- a/数据表/Scene.txt +++ b/数据表/Scene.txt @@ -5,4 +5,4 @@ 1 菜单场景 Menu 1 2 战斗场景 Main 2 3 压力测试场景 StressTest 0 - 4 玩法A测试场景 GameplayA 0 \ No newline at end of file + 4 GameplayA 0 diff --git a/数据表/Scene.xlsx b/数据表/Scene.xlsx index 3bb1e1a..bdc5b47 100644 Binary files a/数据表/Scene.xlsx and b/数据表/Scene.xlsx differ diff --git a/数据表/UIForm.txt b/数据表/UIForm.txt index 20740d2..eccc80b 100644 --- a/数据表/UIForm.txt +++ b/数据表/UIForm.txt @@ -6,4 +6,7 @@ 100 主菜单 MenuForm Default False True 101 设置 SettingForm Default False True 102 关于 AboutForm Default False True - 103 淨A MVCԽ CoreGameplayAMvcForm Default False True + 103 组装玩法UI CombineForm Default False False + 104 Mask对话UI MaskDialogForm Default False False + 105 Bottom对话UI BottomBoxDialogForm Default False False + 106 Bubble对话UI BubbleDialogForm Default True False diff --git a/数据表/UIForm.xlsx b/数据表/UIForm.xlsx index db32a7a..ba5c519 100644 Binary files a/数据表/UIForm.xlsx and b/数据表/UIForm.xlsx differ diff --git a/数据表/Weapon.txt b/数据表/Weapon.txt deleted file mode 100644 index 8d2b3fd..0000000 --- a/数据表/Weapon.txt +++ /dev/null @@ -1,5 +0,0 @@ -# 武器表 -# Id Attack AttackInterval BulletId BulletSpeed BulletSoundId -# int int float int float int -# 武器编号 策划备注 攻击力 攻击间隔 子弹编号 子弹速度 子弹声音编号 - 30000 玩家武器 100 0.2 50000 20 10000 diff --git a/数据表/Weapon.xlsx b/数据表/Weapon.xlsx deleted file mode 100644 index d1a4057..0000000 Binary files a/数据表/Weapon.xlsx and /dev/null differ diff --git a/数据表/convert.py b/数据表/convert.py index 82e3435..5ca4b8a 100644 --- a/数据表/convert.py +++ b/数据表/convert.py @@ -1,45 +1,54 @@ -import pandas as pd -import os +import os import shutil +import pandas as pd + + def convert_excel_to_txt(folder_path='.'): - # 计数器,用于最后汇总 + # 计数器,用于最后统计 count = 0 target_dir = os.path.join(os.path.dirname(__file__), '../Assets/GameMain/DataTables') target_dir = os.path.abspath(target_dir) - + # 确保目标目录存在 os.makedirs(target_dir, exist_ok=True) - - for file_name in os.listdir(folder_path): - if file_name.endswith(('.xlsx', '.xls')): - file_path = os.path.join(folder_path, file_name) + + for root, _, files in os.walk(folder_path): + for file_name in files: + if not file_name.lower().endswith(('.xlsx', '.xls')): + continue + # 跳过 Excel 临时锁文件 + if file_name.startswith('~$'): + continue + + file_path = os.path.join(root, file_name) base_name = os.path.splitext(file_path)[0] - output_file = base_name.replace(os.path.basename(base_name), os.path.basename(base_name)) + '.txt' - - print(f"正在处理: {file_name}...") - + output_file = base_name + '.txt' + + print(f"正在处理: {file_path}...") + try: - df = pd.read_excel(file_path, header=None) - + # 保留单元格中的 "None" 文本,避免被 pandas 当作缺失值转为空 + df = pd.read_excel(file_path, header=None, keep_default_na=False) + df.to_csv(output_file, sep='\t', index=False, header=False, encoding='utf-8') - + # 复制文件到目标目录 target_file = os.path.join(target_dir, os.path.basename(output_file)) shutil.copy2(output_file, target_file) - + print(f"成功转换 -> {output_file}") print(f"已复制到 -> {target_file}") count += 1 - + except Exception as e: - print(f"处理 {file_name} 时出错: {e}") + print(f"处理 {file_path} 时出错: {e}") print(f"\n任务完成!共转换了 {count} 个文件。") + if __name__ == "__main__": convert_excel_to_txt('.') - - # --- 关键修改:在这里添加暂停 --- - print("\n" + "="*30) - input("按回车键(Enter)退出程序...") \ No newline at end of file + + print("\n" + "=" * 30) + input("按回车键(Enter)退出程序...")