| | |
| | | using UnityEngine; |
| | | using TableConfig; |
| | | using System;
|
| | | using System.Linq;
|
| | |
|
| | | namespace Snxxz.UI
|
| | | {
|
| | |
| | | }
|
| | |
|
| | | public int talentResetBook { get; private set; }
|
| | | public int storeId { get; private set; }
|
| | | public int talentResetBookCost { get; private set; }
|
| | | Dictionary<int, List<int>> jobTalentTypeDict = new Dictionary<int, List<int>>();
|
| | | void ParseConfig()
|
| | | {
|
| | | var configs = Config.Instance.GetAllValues<TalentConfig>();
|
| | |
| | | talentTreeDict.Add(skillConfig.UseType, talentTree);
|
| | | }
|
| | | talentTree.Add(configs[i], skillConfig.SkillTypeID);
|
| | |
|
| | | List<int> list = null;
|
| | | if (!jobTalentTypeDict.TryGetValue(skillConfig.UseType, out list))
|
| | | {
|
| | | list = new List<int>();
|
| | | jobTalentTypeDict.Add(skillConfig.UseType, list);
|
| | | }
|
| | | if (!list.Contains(configs[i].type))
|
| | | {
|
| | | list.Add(configs[i].type);
|
| | | }
|
| | | }
|
| | | }
|
| | | var jobs = jobTalentTypeDict.Keys.ToList();
|
| | | for (int i = 0; i < jobs.Count; i++)
|
| | | {
|
| | | var list = jobTalentTypeDict[jobs[i]];
|
| | | list.Sort((x, y) =>
|
| | | {
|
| | | return x.CompareTo(y);
|
| | | });
|
| | | }
|
| | |
|
| | |
|
| | | var config = Config.Instance.Get<FuncConfigConfig>("");
|
| | | if (config != null)
|
| | | {
|
| | | talentResetBook = int.Parse(config.Numerical1);
|
| | | talentResetBookCost = int.Parse(config.Numerical2);
|
| | | }
|
| | | var storeConfigs = Config.Instance.GetAllValues<StoreConfig>();
|
| | | for (int i = 0; i < storeConfigs.Count; i++)
|
| | | }
|
| | |
|
| | | public int GetTalentType(int index)
|
| | | {
|
| | | var job = (int)Math.Pow(2, PlayerDatas.Instance.baseData.Job);
|
| | | if (jobTalentTypeDict.ContainsKey(job))
|
| | | {
|
| | | if (storeConfigs[i].ItemID == talentResetBook)
|
| | | {
|
| | | storeId = storeConfigs[i].ID;
|
| | | break;
|
| | | }
|
| | | var list = jobTalentTypeDict[job];
|
| | | return index < list.Count ? list[index] : list[0];
|
| | | }
|
| | | return 1;
|
| | | }
|
| | |
|
| | | public bool TryGetTalents(int job, int talentType, int talentSeries, out List<int> talents)
|