UI HUGE UPDATE
This commit is contained in:
@@ -51,11 +51,15 @@ namespace Bansonic
|
||||
continue;
|
||||
}
|
||||
|
||||
Sprite backgroundSprite = entry.useCustomColor
|
||||
? null
|
||||
: ResolveRarityBackgroundSprite(entry.rarity);
|
||||
|
||||
Color qualityColor = entry.useCustomColor
|
||||
? entry.customColor
|
||||
: ResolveRarityColor(entry.rarity);
|
||||
|
||||
item.Bind(entry.icon, entry.displayName, entry.amount, qualityColor);
|
||||
item.Bind(entry.icon, entry.displayName, entry.amount, qualityColor, backgroundSprite);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -191,17 +195,10 @@ namespace Bansonic
|
||||
|
||||
private static Color ResolveRarityColor(ItemRarity rarity)
|
||||
{
|
||||
if (cachedRarityConfig == null)
|
||||
ItemRarityColorConfigSO rarityConfig = GetRarityConfig();
|
||||
if (rarityConfig != null)
|
||||
{
|
||||
#if UNITY_EDITOR
|
||||
cachedRarityConfig = UnityEditor.AssetDatabase.LoadAssetAtPath<ItemRarityColorConfigSO>(
|
||||
"Assets/playerBagSystem/ItemRarityColorConfig.asset");
|
||||
#endif
|
||||
}
|
||||
|
||||
if (cachedRarityConfig != null)
|
||||
{
|
||||
return cachedRarityConfig.GetColor(rarity, FallbackColor);
|
||||
return rarityConfig.GetColor(rarity, FallbackColor);
|
||||
}
|
||||
|
||||
switch (rarity)
|
||||
@@ -225,6 +222,34 @@ namespace Bansonic
|
||||
}
|
||||
}
|
||||
|
||||
private static Sprite ResolveRarityBackgroundSprite(ItemRarity rarity)
|
||||
{
|
||||
ItemRarityColorConfigSO rarityConfig = GetRarityConfig();
|
||||
return rarityConfig != null
|
||||
? rarityConfig.GetBackgroundSprite(rarity, null)
|
||||
: null;
|
||||
}
|
||||
|
||||
private static ItemRarityColorConfigSO GetRarityConfig()
|
||||
{
|
||||
if (currentController != null && currentController.rarityColorConfig != null)
|
||||
{
|
||||
cachedRarityConfig = currentController.rarityColorConfig;
|
||||
return cachedRarityConfig;
|
||||
}
|
||||
|
||||
if (cachedRarityConfig != null)
|
||||
{
|
||||
return cachedRarityConfig;
|
||||
}
|
||||
|
||||
#if UNITY_EDITOR
|
||||
cachedRarityConfig = UnityEditor.AssetDatabase.LoadAssetAtPath<ItemRarityColorConfigSO>(
|
||||
"Assets/playerBagSystem/ItemRarityColorConfig.asset");
|
||||
#endif
|
||||
return cachedRarityConfig;
|
||||
}
|
||||
|
||||
private static Color ResolveEquipmentColor(equipmentSO equipment)
|
||||
{
|
||||
if (equipment == null)
|
||||
|
||||
Reference in New Issue
Block a user