| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990 |
- using GameLogic.Bag;
- namespace Fort23.Mono
- {
- [UIBinding(prefab = "DivineSenceInfoBtnWidget")]
- public partial class DivineSenceInfoBtnWidget : ItemWidgetBasic
- {
- public ItemInfo ItemInfo;
- public int type;
- private void Init()
- {
- }
- public override void AddEvent()
- {
- }
- public override void DelEvent()
- {
- }
- public override void AddButtonEvent()
- {
- base.AddButtonEvent();
- }
- public void CustomInit(int id, int type)
- {
- this.type = type;
- if (type == 1)
- {
- Icon_ItemIcon.gameObject.SetActive(false);
- Icon_ShenIcon.gameObject.SetActive(true);
- Text_ItemCount.text =
- $"{(int)AccountFileInfo.Instance.playerData.divineSensePoint}/<color=#EF9F32>{100 * 1}</color>";
- }
- else
- {
- if (id == -1)
- {
- ItemInfo = null;
- Icon_ItemIcon.gameObject.SetActive(false);
- Icon_ShenIcon.gameObject.SetActive(false);
- Text_ItemCount.text = "";
- icon_Jia.gameObject.SetActive(true);
- }
- else
- {
- icon_Jia.gameObject.SetActive(false);
- ItemInfo = PlayerManager.Instance.BagController.GetItemInfo(id);
- Icon_ItemIcon.gameObject.SetActive(transform);
- Icon_ShenIcon.gameObject.SetActive(false);
- Text_ItemCount.text = $"{1}/{ItemInfo.count.Value.ToString()}";
- if (ItemInfo.config.associateID == 7)
- {
- Icon_ItemIcon.icon_name = "icon_shenshitishengfu";
- Icon_ItemIcon2.icon_name = ItemInfo.config.icon;
- Icon_ItemIcon2.gameObject.SetActive(true);
- }
- else
- {
- Icon_ItemIcon.icon_name = ItemInfo.config.icon;
- Icon_ItemIcon2.gameObject.SetActive(false);
- }
- }
- }
- }
- public void UpdateItermCount(int selectCount)
- {
- if (type == 1)
- {
- Text_ItemCount.text =
- $"{(int)AccountFileInfo.Instance.playerData.divineSensePoint}/<color=#EF9F32>{100 * selectCount}</color>";
- }
- else
- {
- if (ItemInfo != null)
- {
- selectCount = selectCount > ItemInfo.count.Value ? (int)ItemInfo.count.Value : selectCount;
- Text_ItemCount.text = $"{ItemInfo.count.Value.ToString()}/<color=#EF9F32>{selectCount}</color>";
- }
- }
- }
- }
- }
|