123456789101112131415161718192021222324252627282930313233343536373839404142 |
- 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 = SuitCfgArray.Instance.GetCfg(id);
- rarity = suitCfg.rarity;
- }
- else
- {
- ItemCfg itemCfg = ItemCfgArray.Instance.GetCfg(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;
- }
- }
- }
- }
|