public static void LoadCiviloPedia() { if (Civilopedias != null) { return; } TextAsset textAsset = Resources.Load <TextAsset>("Civilopedia/BGO.2.0"); var dictStr = textAsset.text; Civilopedias = new Dictionary <string, TtaCivilopedia>(); var civilopedia = new TtaCivilopedia(); civilopedia.cardInfos = new Dictionary <string, CardInfo>(); var rows = dictStr.Split("\n".ToCharArray()); foreach (var row in rows) { var csvRow = CsvUtil.SplitRow(row.Trim()); if (csvRow.Count != 20) { continue; } try { CardInfo info = new CardInfo { InternalId = csvRow[0], CardName = TtaTranslation.GetTranslatedText(csvRow[1]).Trim(), CardType = (CardType)Convert.ToInt32(csvRow[2]), CardAge = (Age)Convert.ToInt32(csvRow[3]), Description = csvRow[4], NormalImage = "SpriteTile/Cards/" + csvRow[5].Replace(".png", "") }; info.SmallImage = info.NormalImage + "_small"; UnityResources.LazyLoadSprite(info.SmallImage, () => UnityResources.ZoomSprite(info.NormalImage, new Vector2(0.5f, 0.5f), 70f / 297f)); info.SpecialImage = "SpriteTile/Cards/" + csvRow[6].Replace(".png", ""); info.Package = csvRow[7]; info.ResearchCost = ToIntList(csvRow[8], "/"); info.BuildCost = ToIntList(csvRow[9], ","); info.RedMarkerCost = ToIntList(csvRow[10], "|"); info.ImmediateEffects = new List <CardEffect>(); info.ImmediateEffects.AddRange(CreateEffects(csvRow[11])); //使用效果(ActionCard专用) info.ImmediateEffects.AddRange(CreateEffects(csvRow[12])); //一次性效果(ColonyCard专用) info.SustainedEffects = CreateEffects(csvRow[13]); //持续效果 info.AffectedTrget = ToIntList(csvRow[14], ","); //6月6日新加:影响对象 info.WinnerEffects = CreateEffects(csvRow[15]); info.LoserEffects = CreateEffects(csvRow[16]); info.TacticComposition = ToIntList(csvRow[17], ","); info.TacticValue = string.IsNullOrEmpty(csvRow[18]) ? new List <int>() : csvRow[18].Split("/".ToCharArray()) .Select(a => Convert.ToInt32(a.Split(",".ToCharArray())[2])) .ToList(); info.ImmediateEffects.AddRange(CreateEffects(csvRow[19])); //领袖技能主动使用效果(LeaderCard专用) civilopedia.cardInfos[info.InternalId] = info; } catch (Exception e) { LogRecorder.Log(e.Message + " " + row); } } Civilopedias.Add("2.0", civilopedia); }