using System.Collections; using System.Collections.Generic; using UnityEngine; public partial class WashLevelMaxConfig : IConfigPostProcess { static Dictionary washLevelMaxConfigs = new Dictionary(); public void OnConfigParseCompleted() { var key = equipType * 100 + equipStar; washLevelMaxConfigs[key] = this; } public static WashLevelMaxConfig Get(int type, int star) { var key = type * 100 + star; return washLevelMaxConfigs.ContainsKey(key) ? washLevelMaxConfigs[key] : null; } public static int GetMaxLevel( int type) { var max = 0; foreach ( var config in washLevelMaxConfigs.Values) { if ( config .equipType==type && config .levelMax >max) { max = config.levelMax; } } return max; } }