// void UpdateSellBtnStatus() // { // bool isEnabel = SelectItemList.Count>0; // SellButton.SetImageButtonComponentActive(isEnabel?true:false); // SellButton.SetButtonBackground(isEnabel?1:2); // SellButton.gameObject.collider.enabled = isEnabel; // } void OnItemCLick(object obj) { ItemFielInfo clickItemInfo = obj as ItemFielInfo; SinglePackItemSlot clickItem = MyItemList.First(P => P.MyItemFileInfo == clickItemInfo); bool selectStatus = !clickItem.IsSelect; clickItem.SetSelectStatus(selectStatus); if (selectStatus && !SelectItemList.Contains(clickItem)) { SelectItemList.Add(clickItem); } else if (!selectStatus && SelectItemList.Contains(clickItem)) { SelectItemList.Remove(clickItem); } //UpdateSellBtnStatus(); }
void OnFastSelectBtnClick(object obj) { SoundManager.Instance.PlaySoundEffect("Sound_Button_Equipment_Confirm"); List <SinglePackItemSlot> selectableItem = MyItemList.FindAll(P => P.MyItemFileInfo != null); // 所有已装备的装备本地信息 List <EquipmentData> equipedDataList = new List <EquipmentData>(); ContainerInfomanager.Instance.GetEquiptItemList().ApplyAllItem(P => equipedDataList.Add(P.LocalItemData as EquipmentData)); foreach (var item in selectableItem) { ItemData goodsLocalData = item.MyItemFileInfo.LocalItemData; // 判断是否可以快速选择 if (IsCanFastSelect(goodsLocalData, equipedDataList)) { item.SetSelectStatus(true); SelectItemList.Add(item); } } }