| 1234567891011121314151617181920212223242526272829303132333435363738394041424344 |
- using cfg.GfgCfg;
- using ET;
- using FairyGUI;
- namespace GFGGame
- {
- public class RarityIconController
- {
- public static void UpdateRarityIcon(GLoader rarityUI, int id, bool isSmall, bool isSuit = false)
- {
- string prefix = null;
- if(isSmall)
- {
- prefix = "zx_bq_shuxing_";
- }
- else
- {
- prefix = "hz_bq_shuxing_";
- }
- int rarity = 0;
- if (isSuit)
- {
- SuitCfg suitCfg = CommonDataManager.Tables.TblSuitCfg.GetOrDefault(id);
- rarity = suitCfg.Rarity;
- }
- else
- {
- ItemCfg itemCfg = CommonDataManager.Tables.TblItemCfg.GetOrDefault(id);
- if(itemCfg.ItemType == ConstItemType.DRESS_UP || itemCfg.ItemType == ConstItemType.CARD)
- rarity = itemCfg.Rarity;
- }
-
- if(rarity > 0)
- {
- rarityUI.url = "ui://CommonGame/" + prefix + rarity;
- rarityUI.visible = true;
- }
- else
- {
- rarityUI.visible = false;
- }
- }
- }
- }
|