using System; using System.Collections; using System.Collections.Generic; using System.Linq; using System.Text; using GFGGame; using UnityEngine; namespace GFGEditor { public class LeagueScanner { private static Dictionary skilCountDic = new Dictionary(); private static Dictionary layerCountDic = new Dictionary(); private static string[] names = { "选茶", "备器", "择水", "取火", "候汤", "习茶" }; public static void StartScan() { skilCountDic.Clear(); layerCountDic.Clear(); int typeValue = 1; List skillCfgs = LeagueSkillCfgArray.Instance.GetCfgsBytype(typeValue); while (skillCfgs != null && skillCfgs.Count > 0) { skilCountDic[typeValue] = skillCfgs.Count; layerCountDic[typeValue] = 0; int layer = 1; List skillLayerCfgs = LeagueSkillCfgArray.Instance.GetCfgsBytypeAndlayer(typeValue, layer); while (skillLayerCfgs != null && skillLayerCfgs.Count > 0) { layerCountDic[typeValue] = layer; layer++; skillLayerCfgs = LeagueSkillCfgArray.Instance.GetCfgsBytypeAndlayer(typeValue, layer); } typeValue++; skillCfgs = LeagueSkillCfgArray.Instance.GetCfgsBytype(typeValue); } SQLiteHelper.Instance.OpenConnection(); try { ICollection keys = layerCountDic.Keys; foreach (int key in skilCountDic.Keys) { string type = key.ToString(); string layerCount = layerCountDic[key].ToString(); string skillCount = skilCountDic[key].ToString(); var names = new string[] { "layerCount", "skillCount" }; var values = new string[] { layerCount, skillCount }; SQLiteHelper.Instance.UpdateValues(nameof(LeagueSkillCountCfgArray), names, values, "type", key.ToString()); // SQLiteHelper.Instance.InsertValues(nameof(LeagueSkillCountCfgArray), values); } } catch (Exception e) { ET.Log.Error(e.ToString()); } finally { SQLiteHelper.Instance.CloseConnection(); } } } }