| | |
| | | //-------------------------------------------------------- |
| | | // [Author]: YYL |
| | | // [ Date ]: 2025年6月16日 |
| | | //-------------------------------------------------------- |
| | | |
| | | using System.Collections.Generic; |
| | | using System.IO; |
| | | using System.Threading; |
| | | using System; |
| | | using UnityEngine; |
| | | using LitJson; |
| | | |
| | | public partial class HeroConfig : ConfigBase<int, HeroConfig> |
| | | { |
| | | |
| | | public int HeroID; |
| | | public int Country; |
| | | public int Quality; |
| | | public int[] SkinNPCIDList; |
| | | public int AtkSkillID; |
| | | public int AngerSkillID; |
| | | public int AtkInheritPer; |
| | | public int DefInheritPer; |
| | | public int HPInheritPer; |
| | | public string BatAttrDict; |
| | | public int[] FetterIDList; |
| | | |
| | | public override int LoadKey(string _key) |
| | | { |
| | | int key = GetKey(_key); |
| | | return key; |
| | | } |
| | | |
| | | public override void LoadConfig(string input) |
| | | { |
| | | try { |
| | | string[] tables = input.Split('\t'); |
| | | int.TryParse(tables[0],out HeroID); |
| | | |
| | | int.TryParse(tables[1],out Country); |
| | | |
| | | int.TryParse(tables[2],out Quality); |
| | | |
| | | if (tables[3].Contains("[")) |
| | | //--------------------------------------------------------
|
| | | // [Author]: YYL
|
| | | // [ Date ]: 2025年7月26日
|
| | | //--------------------------------------------------------
|
| | |
|
| | | using System.Collections.Generic;
|
| | | using System;
|
| | | using UnityEngine;
|
| | | using LitJson;
|
| | |
|
| | | public partial class HeroConfig : ConfigBase<int, HeroConfig>
|
| | | {
|
| | |
|
| | | public int HeroID;
|
| | | public string Name;
|
| | | public int Country;
|
| | | public int Quality;
|
| | | public int Class;
|
| | | public int[] SkinIDList;
|
| | | public int AtkSkillID;
|
| | | public int AngerSkillID;
|
| | | public int AtkInheritPer;
|
| | | public int DefInheritPer;
|
| | | public int HPInheritPer;
|
| | | public string BatAttrDict;
|
| | | public int[] FetterIDList;
|
| | | public float UIScale;
|
| | |
|
| | | public override int LoadKey(string _key)
|
| | | {
|
| | | int key = GetKey(_key);
|
| | | return key;
|
| | | }
|
| | |
|
| | | public override void LoadConfig(string input)
|
| | | {
|
| | | try {
|
| | | string[] tables = input.Split('\t');
|
| | | int.TryParse(tables[0],out HeroID); |
| | |
|
| | | Name = tables[1];
|
| | |
|
| | | int.TryParse(tables[2],out Country); |
| | |
|
| | | int.TryParse(tables[3],out Quality); |
| | |
|
| | | int.TryParse(tables[4],out Class); |
| | |
|
| | | if (tables[5].Contains("[")) |
| | | { |
| | | SkinNPCIDList = JsonMapper.ToObject<int[]>(tables[3]); |
| | | SkinIDList = JsonMapper.ToObject<int[]>(tables[5]); |
| | | } |
| | | else |
| | | { |
| | | string[] SkinNPCIDListStringArray = tables[3].Trim().Split(StringUtility.splitSeparator,StringSplitOptions.RemoveEmptyEntries); |
| | | SkinNPCIDList = new int[SkinNPCIDListStringArray.Length]; |
| | | for (int i=0;i<SkinNPCIDListStringArray.Length;i++) |
| | | string[] SkinIDListStringArray = tables[5].Trim().Split(StringUtility.splitSeparator,StringSplitOptions.RemoveEmptyEntries); |
| | | SkinIDList = new int[SkinIDListStringArray.Length]; |
| | | for (int i=0;i<SkinIDListStringArray.Length;i++) |
| | | { |
| | | int.TryParse(SkinNPCIDListStringArray[i],out SkinNPCIDList[i]); |
| | | int.TryParse(SkinIDListStringArray[i],out SkinIDList[i]); |
| | | } |
| | | } |
| | | |
| | | int.TryParse(tables[4],out AtkSkillID); |
| | | |
| | | int.TryParse(tables[5],out AngerSkillID); |
| | | |
| | | int.TryParse(tables[6],out AtkInheritPer); |
| | | |
| | | int.TryParse(tables[7],out DefInheritPer); |
| | | |
| | | int.TryParse(tables[8],out HPInheritPer); |
| | | |
| | | BatAttrDict = tables[9]; |
| | | |
| | | if (tables[10].Contains("[")) |
| | | }
|
| | |
|
| | | int.TryParse(tables[6],out AtkSkillID); |
| | |
|
| | | int.TryParse(tables[7],out AngerSkillID); |
| | |
|
| | | int.TryParse(tables[8],out AtkInheritPer); |
| | |
|
| | | int.TryParse(tables[9],out DefInheritPer); |
| | |
|
| | | int.TryParse(tables[10],out HPInheritPer); |
| | |
|
| | | BatAttrDict = tables[11];
|
| | |
|
| | | if (tables[12].Contains("[")) |
| | | { |
| | | FetterIDList = JsonMapper.ToObject<int[]>(tables[10]); |
| | | FetterIDList = JsonMapper.ToObject<int[]>(tables[12]); |
| | | } |
| | | else |
| | | { |
| | | string[] FetterIDListStringArray = tables[10].Trim().Split(StringUtility.splitSeparator,StringSplitOptions.RemoveEmptyEntries); |
| | | string[] FetterIDListStringArray = tables[12].Trim().Split(StringUtility.splitSeparator,StringSplitOptions.RemoveEmptyEntries); |
| | | FetterIDList = new int[FetterIDListStringArray.Length]; |
| | | for (int i=0;i<FetterIDListStringArray.Length;i++) |
| | | { |
| | | int.TryParse(FetterIDListStringArray[i],out FetterIDList[i]); |
| | | } |
| | | } |
| | | } |
| | | catch (Exception exception) |
| | | { |
| | | Debug.LogError(exception); |
| | | } |
| | | } |
| | | } |
| | | }
|
| | |
|
| | | float.TryParse(tables[13],out UIScale); |
| | | }
|
| | | catch (Exception exception)
|
| | | {
|
| | | Debug.LogError(exception);
|
| | | }
|
| | | }
|
| | | }
|