From a36e603531ad301cc144e88bce640e9b16d38e34 Mon Sep 17 00:00:00 2001 From: chai <215380520@qq.com> Date: Fri, 2 Jun 2023 21:39:27 +0800 Subject: *misc --- WorldlineKeepers/Assets/Scripts/Tools/CSVReader.cs | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'WorldlineKeepers/Assets/Scripts/Tools') 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 row = m_Rows[i]; T obj = new T(); foreach (var key in m_KeyMapping) -- cgit v1.1-26-g67d0