| | |
| | | using System;
|
| | | using System.Collections.Generic;
|
| | | using UnityEngine;
|
| | | using vnxbqy.UI;
|
| | | public class ChooseItems
|
| | | {
|
| | |
| | | public int boxChooseCount = 0; // 每个宝箱可以在列表中选择x个
|
| | | public int totalItemCount = 0; // 总共能选x个材料
|
| | | public int chooseKeyBoardItemId = 0; //当前键盘输入哪个ItemId的数量
|
| | |
|
| | | public readonly int MaxBoxCount = 60000; //箱子单次使用上限,堆叠上限目前单次使用60000
|
| | | //<物品ID,数量> 用户选中物品字典
|
| | | public Dictionary<int, ChooseItems> userChooseItemDict = new Dictionary<int, ChooseItems>();
|
| | | public Dictionary<int, int> showDict = new Dictionary<int, int>();
|
| | |
| | | {
|
| | | if (!TryInitData())
|
| | | return;
|
| | | this.openBoxCount = openBoxCount;
|
| | | this.openBoxCount = Mathf.Min(packModel.GetItemCountByID(PackType.Item, boxModel.itemId), MaxBoxCount);
|
| | | if (this.openBoxCount < 1)
|
| | | return;
|
| | | this.boxChooseCount = boxChooseCount;
|
| | | totalItemCount = openBoxCount * boxChooseCount;
|
| | | WindowCenter.Instance.Open<ChooseItemsWin>();
|
| | |
| | | {
|
| | | if (!TryInitData())
|
| | | return;
|
| | | this.openBoxCount = packModel.GetItemCountByID(PackType.Item, boxModel.itemId);
|
| | | this.openBoxCount = Mathf.Min(packModel.GetItemCountByID(PackType.Item, boxModel.itemId), MaxBoxCount);
|
| | | if (this.openBoxCount < 1)
|
| | | return;
|
| | | this.boxChooseCount = 1;
|