| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869 | 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<int, int> skilCountDic = new Dictionary<int, int>();        private static Dictionary<int, int> layerCountDic = new Dictionary<int, int>();        private static string[] names = { "选茶", "备器", "择水", "取火", "候汤", "习茶" };        public static void StartScan()        {            skilCountDic.Clear();            layerCountDic.Clear();            int typeValue = 1;            List<LeagueSkillCfg> skillCfgs = LeagueSkillCfgArray.Instance.GetCfgsBytype(typeValue);            while (skillCfgs != null && skillCfgs.Count > 0)            {                skilCountDic[typeValue] = skillCfgs.Count;                layerCountDic[typeValue] = 0;                int layer = 1;                List<LeagueSkillCfg> 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<int> 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();            }        }    }}
 |