1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071 |
- 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(transform);
- // Icon_ItemIcon.icon_name = ItemInfo.config.icon;
- Text_ItemCount.text = $"{100 * 1}/{AccountFileInfo.Instance.playerData.divineSensePoint}";
- }
- else
- {
- if (id == -1)
- {
- ItemInfo = null;
- Icon_ItemIcon.gameObject.SetActive(false);
- Text_ItemCount.text = "";
- }
- else
- {
- ItemInfo = PlayerManager.Instance.BagController.GetItemInfo(id);
- Icon_ItemIcon.gameObject.SetActive(transform);
- Icon_ItemIcon.icon_name = ItemInfo.config.icon;
- Text_ItemCount.text = $"{1}/{ItemInfo.count.Value.ToString()}";
- }
- }
- }
- public void UpdateItermCount(int selectCount)
- {
- if (type == 1)
- {
- Text_ItemCount.text = $"{100 * selectCount}/{AccountFileInfo.Instance.playerData.divineSensePoint}";
- }
- else
- {
- if (ItemInfo != null)
- {
- Text_ItemCount.text = $"{selectCount}/{ItemInfo.count.Value.ToString()}";
- }
- }
- }
- }
- }
|