diff options
author | chai <215380520@qq.com> | 2023-06-02 21:39:27 +0800 |
---|---|---|
committer | chai <215380520@qq.com> | 2023-06-02 21:39:27 +0800 |
commit | a36e603531ad301cc144e88bce640e9b16d38e34 (patch) | |
tree | af083bfc9f452da4127f0a517c858a177f701685 /WorldlineKeepers/Assets/Scripts | |
parent | db644274ae95a6fd0a3224d0dc848702615ff309 (diff) |
*misc
Diffstat (limited to 'WorldlineKeepers/Assets/Scripts')
8 files changed, 33 insertions, 35 deletions
diff --git a/WorldlineKeepers/Assets/Scripts/Battle/Metadata/StageMetadata.cs b/WorldlineKeepers/Assets/Scripts/Battle/Metadata/StageMetadata.cs index b530390..1fc5c2a 100644 --- a/WorldlineKeepers/Assets/Scripts/Battle/Metadata/StageMetadata.cs +++ b/WorldlineKeepers/Assets/Scripts/Battle/Metadata/StageMetadata.cs @@ -11,7 +11,7 @@ namespace WK.Data /// </summary> public abstract class StageEntityMetadatas { - public string entityId; + public string entityId; // 用来引用场景中的对象 } public class StageDesc @@ -36,3 +36,4 @@ namespace WK.Data } } + diff --git a/WorldlineKeepers/Assets/Scripts/Battle/SceneManager.cs b/WorldlineKeepers/Assets/Scripts/Battle/SceneManager.cs index ac800ee..15fc861 100644 --- a/WorldlineKeepers/Assets/Scripts/Battle/SceneManager.cs +++ b/WorldlineKeepers/Assets/Scripts/Battle/SceneManager.cs @@ -10,18 +10,13 @@ namespace WK /// </summary> public class GameSceneManager : Singleton<GameSceneManager> { - private AsyncOperation m_AsyncOpt = null; - public AsyncOperation AsyncOpt - { - get - { - return m_AsyncOpt; - } - } + private AsyncOperation m_SceneOpt = null; + public AsyncOperation sceneOpt => m_SceneOpt; - public void LoadScene(string sceneName, UnityEngine.SceneManagement.LoadSceneMode loadMode = UnityEngine.SceneManagement.LoadSceneMode.Single) + public AsyncOperation LoadScene(string sceneName, UnityEngine.SceneManagement.LoadSceneMode loadMode = UnityEngine.SceneManagement.LoadSceneMode.Single) { - m_AsyncOpt = UnityEngine.SceneManagement.SceneManager.LoadSceneAsync(sceneName, loadMode); + m_SceneOpt = UnityEngine.SceneManagement.SceneManager.LoadSceneAsync(sceneName, loadMode); + return m_SceneOpt; } diff --git a/WorldlineKeepers/Assets/Scripts/Data/DataManager_Data.cs b/WorldlineKeepers/Assets/Scripts/Data/DataManager_Data.cs index d16c785..6e12d6e 100644 --- a/WorldlineKeepers/Assets/Scripts/Data/DataManager_Data.cs +++ b/WorldlineKeepers/Assets/Scripts/Data/DataManager_Data.cs @@ -11,7 +11,7 @@ namespace WK.Data public partial class DataManager : Singleton<DataManager> { // 文件列表 - private Dictionary<string/*EFileKey*/, MetadataFileDescriptor> m_Filelist = new Dictionary<string, MetadataFileDescriptor>(); + private Dictionary<string/*EFileKey*/, FileDescriptor> m_Filelist = new Dictionary<string, FileDescriptor>(); private Dictionary<string/*uid*/, CharacterStatsMetadata> m_CharacterStatsMetadata = new Dictionary<string, CharacterStatsMetadata>(); private Dictionary<string/*uid*/, BuffMetadata> m_BuffMetadata = new Dictionary<string, BuffMetadata>(); diff --git a/WorldlineKeepers/Assets/Scripts/Data/DataManager_Load.cs b/WorldlineKeepers/Assets/Scripts/Data/DataManager_Load.cs index aab90a9..b7fb0b9 100644 --- a/WorldlineKeepers/Assets/Scripts/Data/DataManager_Load.cs +++ b/WorldlineKeepers/Assets/Scripts/Data/DataManager_Load.cs @@ -33,8 +33,8 @@ namespace WK.Data { TextAsset text = ResourceManager.Instance.LoadAsset<TextAsset>(StaticDefine.FileList); string content = text.text; - List<MetadataFileDescriptor> files = CSVReader.Read<MetadataFileDescriptor>(content); - CSVReader.ReadDictionary<string, MetadataFileDescriptor>(m_Filelist, content, "key"); + List<FileDescriptor> files = CSVReader.Read<FileDescriptor>(content); + CSVReader.ReadDictionary<string, FileDescriptor>(m_Filelist, content, "key"); Debug.Log(m_Filelist.Count); } diff --git a/WorldlineKeepers/Assets/Scripts/Data/Metadata/FileKey.cs b/WorldlineKeepers/Assets/Scripts/Data/Metadata/FileKey.cs index 621203e..2fdff3f 100644 --- a/WorldlineKeepers/Assets/Scripts/Data/Metadata/FileKey.cs +++ b/WorldlineKeepers/Assets/Scripts/Data/Metadata/FileKey.cs @@ -1,22 +1,14 @@ -using System.Collections; -using System.Collections.Generic; -using UnityEngine; - +// 鑷姩鐢熸垚 namespace WK.Data { + public enum EFileKey + { + none = 0, - /// <summary> - /// 默认文件enum,编号无所谓,名字不可更改。方便找文件 - /// </summary> - public enum EFileKey - { - none = 0, - - default_stats, - default_buffs, - default_items, - - all - } + default_stats, + default_buffs, + default_items, + all + } } diff --git a/WorldlineKeepers/Assets/Scripts/Data/Metadata/Filelist.cs b/WorldlineKeepers/Assets/Scripts/Data/Metadata/Filelist.cs index b91619b..c4ae257 100644 --- a/WorldlineKeepers/Assets/Scripts/Data/Metadata/Filelist.cs +++ b/WorldlineKeepers/Assets/Scripts/Data/Metadata/Filelist.cs @@ -26,9 +26,9 @@ namespace WK.Data } /// <summary> - /// 元文件描述符 + /// 文件描述符 /// </summary> - public class MetadataFileDescriptor + public class FileDescriptor { public string key; public FileType type; diff --git a/WorldlineKeepers/Assets/Scripts/Stages/GameStage_Dojo.cs b/WorldlineKeepers/Assets/Scripts/Stages/GameStage_Dojo.cs index c492c5d..2c8094b 100644 --- a/WorldlineKeepers/Assets/Scripts/Stages/GameStage_Dojo.cs +++ b/WorldlineKeepers/Assets/Scripts/Stages/GameStage_Dojo.cs @@ -16,7 +16,7 @@ namespace WK public override IEnumerator<float> OnStart() { GameSceneManager.Instance.LoadScene(StaticDefine.Scene_Dojo); - while(!GameSceneManager.Instance.AsyncOpt.isDone) + while(!GameSceneManager.Instance.sceneOpt.isDone) { yield return 0f; } diff --git a/WorldlineKeepers/Assets/Scripts/Tools/CSVReader.cs b/WorldlineKeepers/Assets/Scripts/Tools/CSVReader.cs index 0ce796e..aa0c925 100644 --- a/WorldlineKeepers/Assets/Scripts/Tools/CSVReader.cs +++ b/WorldlineKeepers/Assets/Scripts/Tools/CSVReader.cs @@ -4,6 +4,7 @@ using Newtonsoft.Json.Serialization; using System; using System.Collections; using System.Collections.Generic; +using System.Linq; using System.Net.Mime; using System.Reflection; using UnityEngine; @@ -50,8 +51,17 @@ public class CSVReader Type type = typeof(T); for (int i = 1; i < m_Rows.Count; ++i) { - if (m_Rows[i][0][0] == '#') // 注释 + if (m_Rows[i] == null || m_Rows[i].Count == 0) // 空行 continue; + + bool isBlank = true; + m_Rows[i].ForEach(s => { if (!string.IsNullOrEmpty(s)) isBlank = false; }); + if (isBlank) + continue; + + if (m_Rows[i][0].Length > 0 && m_Rows[i][0][0] == '#') // 注释 + continue; + List<string> row = m_Rows[i]; T obj = new T(); foreach (var key in m_KeyMapping) |