UI update 02
This commit is contained in:
@@ -494,9 +494,7 @@ public class newTeamSelector : MonoBehaviour
|
||||
|
||||
private static void RebuildHeroCache()
|
||||
{
|
||||
cachedHeroes = Resources.LoadAll<AllyHero_SO>("so/ally");
|
||||
if (cachedHeroes == null || cachedHeroes.Length == 0)
|
||||
cachedHeroes = Resources.LoadAll<AllyHero_SO>("");
|
||||
cachedHeroes = RuntimeResourcesCache.LoadAllAllyHeroes();
|
||||
|
||||
cachedHeroesById = new Dictionary<int, AllyHero_SO>();
|
||||
if (cachedHeroes == null) return;
|
||||
@@ -511,30 +509,6 @@ public class newTeamSelector : MonoBehaviour
|
||||
|
||||
private string GetRatingFromSO(AllyHero_SO so)
|
||||
{
|
||||
if (so == null || so.levelStats == null || so.levelStats.Count == 0) return "C";
|
||||
|
||||
List<AllyHero_SO.AllyLevelInfo> sorted = new List<AllyHero_SO.AllyLevelInfo>();
|
||||
foreach (var level in so.levelStats)
|
||||
{
|
||||
if (level != null)
|
||||
sorted.Add(level);
|
||||
}
|
||||
|
||||
sorted.Sort((left, right) => left.requiredEXP.CompareTo(right.requiredEXP));
|
||||
|
||||
int currentExp = so.ally_currentEXP;
|
||||
int selectedIndex = 0;
|
||||
for (int i = 0; i < sorted.Count; i++)
|
||||
{
|
||||
if (currentExp >= sorted[i].requiredEXP)
|
||||
selectedIndex = i;
|
||||
else
|
||||
break;
|
||||
}
|
||||
|
||||
if (selectedIndex <= 0) return "C";
|
||||
if (selectedIndex == 1) return "B";
|
||||
if (selectedIndex == 2) return "A";
|
||||
return "S";
|
||||
return so != null ? so.GetDisplayLevelRatingKey() : "C";
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user