using System.Collections; using System.Collections.Generic; using UnityEngine; namespace TableConfig { public partial class GodWeaponEffectConfig : ConfigBase, IConfigPostProcess { static Dictionary> configs = new Dictionary>(); public void OnConfigParseCompleted() { if (!configs.ContainsKey(this.type)) { configs[this.type] = new Dictionary(); } configs[this.type][this.level] = this; } public static GodWeaponEffectConfig Get(int type, int level) { if (!configs.ContainsKey(type)) { return null; } GodWeaponEffectConfig config = null; foreach (var item in configs[type].Values) { if (config != null) { if (item.level <= level && item.level > config.level) { config = item; } } else { if (item.level <= level) { config = item; } } } return config; } } }