| | |
| | | playerPackDict.Add(packType, new SinglePack(packType)); |
| | | } |
| | | |
| | | // 先删除所有物品 不止登录的时候会发,其他情况补发 |
| | | var singlePack = playerPackDict[packType]; |
| | | List<string> guidList = new List<string>(); |
| | | if (singlePack != null) |
| | | { |
| | | foreach (var item in singlePack.GetAllItems().Values) |
| | | { |
| | | guidList.Add(item.guid); |
| | | } |
| | | singlePack.Clear(); |
| | | foreach (var guid in guidList) |
| | | { |
| | | if (itemGUIDDict.ContainsKey(guid)) |
| | | { |
| | | if (itemGUIDDict[guid].packType == packType) |
| | | { |
| | | itemGUIDDict.Remove(guid); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | for (int i = 0; i < packInfo.ItemCount; i++) |
| | | { |
| | |
| | | return PackMaxCountDict[(int)type] - GetSinglePack(type).unlockedGridCount; |
| | | } |
| | | |
| | | |
| | | public int GetPackMaxCount(PackType type) |
| | | { |
| | | if (!PackMaxCountDict.ContainsKey((int)type)) |
| | | { |
| | | return 0; |
| | | } |
| | | return PackMaxCountDict[(int)type]; |
| | | } |
| | | |
| | | private void UpdateSecond() |
| | | { |
| | | if (isItemChange) |