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