using System.Collections; using System.Collections.Generic; using UnityEngine; public partial class EquipStarConfig : IConfigPostProcess { static Dictionary> equipStarConfigs = new Dictionary>(); public void OnConfigParseCompleted() { var key = Level * 10000 + EquipPlace * 100; if (!equipStarConfigs.ContainsKey(key)) { equipStarConfigs[key] = new List(); } equipStarConfigs[key].Add(this); } public static EquipStarConfig Get(int level, int equipPlace, int star) { var key = level * 10000 + equipPlace * 100; if (equipStarConfigs.ContainsKey(key)) { var configs = equipStarConfigs[key]; foreach (var item in configs) { if (item.Star == star) { return item; } } return null; } else { return null; } } public static List GetConfigs(int level, int equipPlace) { var key = level * 10000 + equipPlace * 100; if (equipStarConfigs.ContainsKey(key)) { return equipStarConfigs[key]; } else { return null; } } }