using System.Collections.Generic; using MoleMole.Config; using UnityEngine; using UnityEngine.EventSystems; using UnityEngine.UI; using proto; namespace MoleMole { public class MaterialUseDialogContext : BaseDialogContext { public AvatarDataItem avatarData; private List _showItemList; private MaterialDataItem _selectedItem; private int _useNumber; public MaterialUseDialogContext(AvatarDataItem avatarData) { config = new ContextPattern { contextName = "MaterialUseDialogContext", viewPrefabPath = "UI/Menus/Dialog/UseMaterialDialog" }; this.avatarData = avatarData; } public override bool OnPacket(NetPacketV1 pkt) { switch (pkt.getCmdId()) { case 27: return OnGetEquipmentDataRsp(pkt.getData()); case 36: return OnAddAvatarExpByMaterialRsp(pkt.getData()); default: return false; } } public override bool OnNotify(Notify ntf) { if (ntf.type == NotifyTypes.SelectItemIconChange) { UpdateSelectedItem((StorageDataItemBase)ntf.body); } return false; } protected override void BindViewCallbacks() { BindViewCallback(base.view.transform.Find("Dialog/Content/Info/UseNum/DecreaseBtn").GetComponent