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/Tools/CSVReader.cs | |
parent | db644274ae95a6fd0a3224d0dc848702615ff309 (diff) |
*misc
Diffstat (limited to 'WorldlineKeepers/Assets/Scripts/Tools/CSVReader.cs')
-rw-r--r-- | WorldlineKeepers/Assets/Scripts/Tools/CSVReader.cs | 12 |
1 files changed, 11 insertions, 1 deletions
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) |