| | |
| | |
|
| | | public override void Init()
|
| | | {
|
| | | |
| | |
|
| | | }
|
| | | public void OnPlayerLoginOk()
|
| | | {
|
| | | |
| | | playerPack.ItemCntAddAct += ItemCntAddAct;
|
| | | playerPack.RefreshItemCountAct += OnItemRefreshEvent;
|
| | |
|
| | | playerPack.ItemCntAddAct += ItemCntAddAct;//物品数量增加
|
| | | playerPack.ItemCntReduceAct += ItemCntReduceAct;//物品数量减少
|
| | | FuncOpen.Instance.OnFuncStateChangeEvent += OnFuncStateChange;
|
| | | ItemModel itemModel = playerPack.GetItemModelByIndex(PackType.rptEquip, (int)RoleEquipType.retWing);
|
| | | if (IsOnePutOn)
|
| | |
| | | {
|
| | | IsOnePutOn = false;
|
| | | }
|
| | | |
| | |
|
| | | }
|
| | | public void OnBeforePlayerDataInitialize()
|
| | | {
|
| | | playerPack.ItemCntAddAct -= ItemCntAddAct;//物品数量刷新
|
| | | playerPack.RefreshItemCountAct -= OnItemRefreshEvent;//背包刷新
|
| | | playerPack.ItemCntAddAct -= ItemCntAddAct;//物品数量增加
|
| | | FuncOpen.Instance.OnFuncStateChangeEvent -= OnFuncStateChange;
|
| | | playerPack.ItemCntReduceAct -= ItemCntReduceAct;//物品数量减少
|
| | | }
|
| | | private void OnItemRefreshEvent(PackType type, int index, int id)
|
| | | {
|
| | | if (type == PackType.rptItem && ItemConfig.tag_Wings.ContainsKey(id)&& IsOnePutOn)
|
| | | {
|
| | | WingsDot();
|
| | | IsOnePutOn = false;
|
| | | }
|
| | | }
|
| | |
|
| | |
|
| | |
|
| | | public override void UnInit()
|
| | | {
|
| | | |
| | |
|
| | | }
|
| | |
|
| | | |
| | |
|
| | |
|
| | | private void OnFuncStateChange(int obj)
|
| | | {
|
| | |
| | | Marking = WingNumber;
|
| | | }
|
| | | }
|
| | | private void ItemCntAddAct(PackType arg1, int WingsItemIndex, int ItemCount)
|
| | | private void ItemCntAddAct(PackType arg1, int ItemIndex, int ItemID)//物品数量增加
|
| | | {
|
| | | if (arg1 == PackType.rptItem)
|
| | |
|
| | | if (arg1 == PackType.rptItem)//物品背包物品增加
|
| | | {
|
| | | if (IsBoolOpenWingeWin)
|
| | | ItemBagAdd(ItemIndex, ItemID);
|
| | | }
|
| | | if (arg1 == PackType.rptEquip)//装备背包物品增加
|
| | | {
|
| | | ItemModel itemModel = playerPack.GetItemModelByIndex(PackType.rptEquip, (int)RoleEquipType.retWing);
|
| | | if (IsOnePutOn)
|
| | | {
|
| | | return;
|
| | | WingsDot();
|
| | | }
|
| | | if (_dicWings.ContainsKey(WingsItemIndex))
|
| | | if (itemModel != null)
|
| | | {
|
| | | if (ItemCount > _dicWings[WingsItemIndex].WingsCount)
|
| | | IsOnePutOn = false;
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | private void ItemBagAdd(int ItemIndex, int ItemID)//物品背包数量添加
|
| | | {
|
| | | ItemModel ItemModel = playerPack.GetItemModelByIndex(PackType.rptItem, ItemIndex);
|
| | | int ItemCount = ItemModel.preItemCount;
|
| | | var WingItem = Config.Instance.Get<WingRefineExpConfig>(ItemModel.itemId);
|
| | | if (IsBoolOpenWingeWin || WingItem == null)
|
| | | {
|
| | | return;
|
| | | }
|
| | | if (_dicWings.ContainsKey(ItemIndex))
|
| | | {
|
| | | if (ItemCount > _dicWings[ItemIndex].WingsCount)
|
| | | {
|
| | | _dicWings[ItemIndex].WingsCount = ItemCount;
|
| | | redPointStre.state = RedPointState.Simple;
|
| | | }
|
| | | else
|
| | | {
|
| | | _dicWings[ItemIndex].WingsCount = ItemCount;
|
| | | }
|
| | | }
|
| | | }
|
| | | private void ItemCntReduceAct(PackType arg1, int Index, int ItemID)
|
| | | {
|
| | | if (arg1 == PackType.rptItem)//物品背包物品减少
|
| | | {
|
| | | var WingItem = Config.Instance.Get<WingRefineExpConfig>(ItemID);
|
| | | if (WingItem != null && _dicWings.ContainsKey(Index))
|
| | | {
|
| | | _dicWings.Remove(Index);
|
| | | if (_dicWings.Count <= 0 && redPointStre.state == RedPointState.Simple)
|
| | | {
|
| | | _dicWings[WingsItemIndex].WingsCount = ItemCount;
|
| | | redPointStre.state = RedPointState.Simple;
|
| | | redPointStre.state = RedPointState.None;
|
| | | return;
|
| | | }
|
| | | else
|
| | | {
|
| | | _dicWings[WingsItemIndex].WingsCount = ItemCount;
|
| | | }
|
| | | }
|
| | | }
|
| | | if (arg1 == PackType.rptEquip)//装备脱下
|
| | | {
|
| | | ItemModel itemModel = playerPack.GetItemModelByIndex(PackType.rptEquip, (int)RoleEquipType.retWing);
|
| | | if (itemModel == null && redPointStre.state == RedPointState.Simple)
|
| | | {
|
| | | redPointStre.state = RedPointState.None;
|
| | | return;
|
| | | }
|
| | | }
|
| | | }
|