示例#1
0
    //public void OnItemDragFinished()
    //{
    //    int dragPosY = (int)m_BackPackItems.transform.localPosition.y;
    //    int startItem = (int)(dragPosY / 80) - 10;
    //    int endItem = (int)(dragPosY / 80) + 15;

    //    for (int nIndex = 0; nIndex < 90; ++nIndex)
    //    {
    //        GameObject ItemObject = m_BackPackItemGrid.transform.FindChild((nIndex + 1000).ToString()).gameObject;
    //        if (ItemObject != null)
    //        {
    //            if (nIndex < startItem || nIndex > endItem)
    //            {
    //                if (ItemObject.activeSelf == true)
    //                {
    //                    ItemObject.SetActive(false);
    //                }
    //            }
    //            else
    //            {
    //                if (ItemObject.activeSelf == false)
    //                {
    //                    ItemObject.SetActive(true);
    //                }
    //            }
    //        }
    //    }
    //}

    static public void SwitchQianKunDaiViewPutInDirectly(bool bSuccess, object param)
    {
        if (bSuccess)
        {
            if (param != null)
            {
                GameItem item = param as GameItem;
                if (null != item && item.IsValid())
                {
                    if (BackPackLogic.Instance() != null)
                    {
                        if (BackPackLogic.Instance().m_TabController2 != null)
                        {
                            BackPackLogic.Instance().m_TabController2.ChangeTab("Tab_Combine");
                        }
                        BackPackLogic.Instance().m_EquipView.SetActive(false);
                        BackPackLogic.Instance().m_QianKunDaiView.SetActive(true);
                        BackPackLogic.Instance().UpdateBackPack();
                        GameManager.gameManager.ActiveScene.HideFakeObj();

                        BackPackItemLogic[] itemsArray = BackPackLogic.Instance().m_BackPackItemGrid.GetComponentsInChildren <BackPackItemLogic>();
                        for (int i = 0; i < itemsArray.Length; i++)
                        {
                            if (null != itemsArray[i] && itemsArray[i].m_Item.Guid == item.Guid)
                            {
                                BackPackLogic.Instance().m_QianKunDai.ChooseStuff(itemsArray[i].m_Item, itemsArray[i].m_ItemSlot);
                                break;
                            }
                        }
                    }
                }
            }
        }
    }
示例#2
0
    void OnDisable()
    {
        if (Singleton <ObjManager> .GetInstance().MainPlayer != null)
        {
            int nNewCombatValue = Singleton <ObjManager> .GetInstance().MainPlayer.BaseAttr.CombatValue;

            if (nNewCombatValue > m_PlayerCombatBuffer)
            {
                int nAddCombatValue = nNewCombatValue - m_PlayerCombatBuffer;
                PowerRemindLogic.InitPowerInfo(nNewCombatValue, nAddCombatValue);
            }
        }
        m_Instance = null;
        DestroyPartnerFakeObj();
        if (GameManager.gameManager.ActiveScene != null)
        {
            GameManager.gameManager.ActiveScene.HideFakeObj();
        }

        if (m_NewPlayerGuideFlag_Step == 2)
        {
            NewPlayerGuide(3);
        }
        m_OpenWay = OPEN_WAY.MENU_BACKPACK;
    }
示例#3
0
 void ShowTooltips()
 {
     if (m_Item != null && m_Item.IsValid())
     {
         if (m_Item.IsEquipMent())
         {
             if (BackPackLogic.Instance().m_QianKunDai != null && BackPackLogic.Instance().m_QianKunDai.gameObject.activeInHierarchy)
             {
                 EquipTooltipsLogic.ShowEquipTooltip(m_Item, EquipTooltipsLogic.ShowType.QianKunDaiStuff, m_ItemSlot);
             }
             else
             {
                 EquipTooltipsLogic.ShowEquipTooltip(m_Item, EquipTooltipsLogic.ShowType.UnEquiped);
             }
         }
         else
         {
             if (BackPackLogic.Instance().m_QianKunDai != null && BackPackLogic.Instance().m_QianKunDai.gameObject.activeInHierarchy)
             {
                 ItemTooltipsLogic.ShowItemTooltip(m_Item, ItemTooltipsLogic.ShowType.QianKunDaiStuff, m_ItemSlot);
             }
             else
             {
                 ItemTooltipsLogic.ShowItemTooltip(m_Item, ItemTooltipsLogic.ShowType.Normal);
             }
         }
     }
 }
示例#4
0
 void ItemUse()
 {
     if (m_Item != null && m_Item.IsValid())
     {
         if (m_NewPlayerGuideFlag_Step == 0)
         {
             NewPlayerGuidLogic.CloseWindow();
             m_NewPlayerGuideFlag_Step = -1;
             if (BackPackLogic.Instance())
             {
                 BackPackLogic.Instance().NewPlayerGuide(2);
             }
         }
         if (null != Singleton <ObjManager> .Instance.MainPlayer &&
             Singleton <ObjManager> .Instance.MainPlayer.CheckUseItem(m_Item))
         {
             Singleton <ObjManager> .Instance.MainPlayer.UseItem(m_Item);
         }
         if (m_Item.DataID == GlobeVar.MARRY_RING_ITEMID)
         {
             if (BackPackLogic.Instance() != null)
             {
                 BackPackLogic.Instance().CloseWindow();
             }
             if (PlayerFrameLogic.Instance() != null)
             {
                 PlayerFrameLogic.Instance().PlayerFrameHeadOnClick();
             }
         }
         CloseWindow();
     }
 }
示例#5
0
    void StuffSlotOnClick(int nItemID, ItemSlotLogic.SLOT_TYPE eItemType, string strSlotName)
    {
        int nDeleteIndex = GlobeVar.INVALID_ID;

        for (int i = 0; i < StuffSlotMax; i++)
        {
            if (i < m_ChooseStuffGuid.Count && i < m_StuffSlotArray.Length)
            {
                if (m_StuffSlotArray[i].gameObject.name == strSlotName)
                {
                    GameItem item = GameManager.gameManager.PlayerDataPool.BackPack.GetItemByGuid(m_ChooseStuffGuid[i]);
                    if (item != null && item.IsValid())
                    {
                        if (m_ChooseStuffKinds.ContainsKey(item.DataID))
                        {
                            m_ChooseStuffKinds[item.DataID] -= item.StackCount;
                            if (m_ChooseStuffKinds[item.DataID] == 0)
                            {
                                m_ChooseStuffKinds.Remove(item.DataID);
                            }
                            if (BackPackLogic.Instance() != null)
                            {
                                BackPackLogic.Instance().CancelItemSlotChoose(item.Guid);
                            }
                            m_ChooseStuffGuid.Remove(item.Guid);
                            nDeleteIndex = i;
                            break;
                        }
                    }
                }
            }
        }

        if (nDeleteIndex != GlobeVar.INVALID_ID)
        {
            for (int i = nDeleteIndex; i < StuffSlotMax; i++)
            {
                if (i < m_ChooseStuffGuid.Count)
                {
                    GameItem item = GameManager.gameManager.PlayerDataPool.BackPack.GetItemByGuid(m_ChooseStuffGuid[i]);
                    if (item != null && item.IsValid())
                    {
                        m_StuffSlotArray[i].InitInfo_Item(item.DataID, StuffSlotOnClick, item.StackCount.ToString());
                        m_StuffSlotArray[i].ItemSlotEnable();
                    }
                }
                else
                {
                    m_StuffSlotArray[i].ClearInfo();
                }
            }
        }

        ClearProductSlot();

        //更新合成说明过滤界面
        UpdateFilter();
    }
示例#6
0
 public void OnBackPackClick()
 {
     NewPlayerGuidLogic.CloseWindow();
     BackPackLogic.m_OpenWay = BackPackLogic.OPEN_WAY.MENU_BACKPACK;
     UIManager.ShowUI(UIInfo.BackPackRoot, BackPackLogic.SwitchEquipPackView);
     if (m_NewPlayerGuideIndex == 3 && BackPackLogic.Instance())
     {
         NewPlayerGuidLogic.CloseWindow();
     }
 }
示例#7
0
    private List <Data> GetDataListCommonItem_2()
    {
        List <Data> res = new List <Data>();

        GameItemContainer EquipPack = GameManager.gameManager.PlayerDataPool.EquipPack;

        for (int index = 0; index < EquipPack.ContainerSize; ++index)
        {
            GameItem equip = EquipPack.GetItem(BackPackLogic.GetEquipSlotByIndex(index));
            if (equip != null && equip.IsValid())
            {
                Data data = new Data();
                data.item = equip;
                res.Add(data);
            }
        }


        GameItemContainer BackPack = GameManager.gameManager.PlayerDataPool.BackPack;
        List <GameItem>   itemall  = ItemTool.ItemFilter(BackPack, 0, 0, false);

        for (int nIndex = 0; nIndex < GameItemContainer.MAXSIZE_BACKPACK; ++nIndex)
        {
            if (nIndex < BackPack.ContainerSize && nIndex < itemall.Count)
            {
                Data data = new Data();
                data.item = itemall[nIndex];
                res.Add(data);
            }
        }

        //道具显示比较特殊,22组为一个Item

//         int itemCount = MAX_COMMONITEM_COUNT;
//         int pageCount = 0;
//         if (res.Count % itemCount == 0)
//         {
//             pageCount = res.Count / itemCount;
//         }
//         else
//         {
//             pageCount = res.Count / itemCount + 1;
//         }
//
//         res.Clear();
//
//         //看有多少页的数据
//         for (int i = 0; i < pageCount; i++)
//         {
//             Data data = new Data();
//             res.Add(data);
//         }

        return(res);
    }
示例#8
0
    private void SetItemSlotInfo(GameItem item)
    {
        if (item != null && item.IsValid())
        {
            m_ItemSlot.InitInfo_Item(item.DataID, ItemSlotOnClick, item.StackCount.ToString());

            if (BackPackLogic.Instance().m_QianKunDai != null)
            {
                m_ItemSlot.SetItemSlotChoose(BackPackLogic.Instance().m_QianKunDai.IsInStuffChoose(item));
            }
        }
    }
示例#9
0
 static public void SwitchQianKunDaiViewFromChristmas(bool bSuccess, object param)
 {
     if (bSuccess)
     {
         if (BackPackLogic.Instance() != null)
         {
             BackPackLogic.Instance().m_EquipView.SetActive(false);
             BackPackLogic.Instance().m_QianKunDaiView.SetActive(true);
             GameManager.gameManager.ActiveScene.HideFakeObj();
             QianKunDaiLogic.IsOpenFromChristmas = true;
         }
     }
 }
示例#10
0
 static public void SwitchEquipPackView(bool bSuccess, object param)
 {
     if (bSuccess)
     {
         if (BackPackLogic.Instance() != null)
         {
             BackPackLogic.Instance().m_EquipView.SetActive(true);
             BackPackLogic.Instance().m_QianKunDaiView.SetActive(false);
             BackPackLogic.Instance().UpdateBackPack();
             GameManager.gameManager.ActiveScene.ShowFakeObj();
         }
     }
 }
示例#11
0
        public uint Execute(PacketDistributed ipacket)
        {
            GC_BACKPACK_RESIZE packet = (GC_BACKPACK_RESIZE)ipacket;

            if (null == packet)
            {
                return((uint)PACKET_EXE.PACKET_EXE_ERROR);
            }

            int packtype = packet.Packtype;
            int newSize  = packet.Size;
            int nType    = packet.Type;

            if (packtype == (int)GameItemContainer.Type.TYPE_BACKPACK)
            {
                int curSize = GameManager.gameManager.PlayerDataPool.BackPack.ContainerSize;
                if (newSize > curSize)
                {
                    int addSize = newSize - curSize;
                    GameManager.gameManager.PlayerDataPool.BackPack.AddContainerSize(addSize);
                    //如果背包界面开着 刷新一下
                    if (BackPackLogic.Instance())
                    {
                        BackPackLogic.Instance().UpdateBackPack();
                    }
                    if (nType == 1)
                    {
                        //type为1时才需要屏幕提示
                        Singleton <ObjManager> .GetInstance().MainPlayer.SendNoticMsg(false, "#{1368}");
                    }
                }
            }
            else if (packtype == (int)GameItemContainer.Type.TYPE_STORAGEPACK)
            {
                int curSize = GameManager.gameManager.PlayerDataPool.StoragePack.ContainerSize;
                if (newSize > curSize)
                {
                    int addSize = newSize - curSize;
                    GameManager.gameManager.PlayerDataPool.StoragePack.AddContainerSize(addSize);
                    if (CangKuLogic.Instance())
                    {
                        CangKuLogic.Instance().UpdateCangKu();
                    }
                }
            }
            //enter your logic
            return((uint)PACKET_EXE.PACKET_EXE_CONTINUE);
        }
示例#12
0
 void NewPlayerGuide(int nIndex)
 {
     m_NewPlayerGuide_Step = nIndex;
     if (nIndex == 0)
     {
         NewPlayerGuidLogic.OpenWindow(m_ItemSlot.gameObject, 100, 100, Utils.GetDicByID(10427), "right", 0, true, true);
     }
     else if (nIndex == 1)
     {
         if (BackPackLogic.Instance())
         {
             BackPackLogic.Instance().NewPlayerGuide(1);
         }
         m_NewPlayerGuide_Step = -1;
     }
 }
示例#13
0
    void Check_NewPlayerGuide()
    {
        if (gameObject.name != "1000")
        {
            return;
        }
        if (BackPackLogic.Instance() == null)
        {
            return;
        }
        int nIndex = BackPackLogic.Instance().NewPlayerGuideFlag_Step;

        if (nIndex == 0)
        {
            NewPlayerGuide(0);
            BackPackLogic.Instance().NewPlayerGuideFlag_Step = -1;
        }
    }
示例#14
0
    void OnEnable()
    {
        m_Instance = this;
        GameManager.gameManager.ActiveScene.InitFakeObjRoot(m_FakeObjTopLeft, m_FakeObjBottomRight);
        GameManager.gameManager.ActiveScene.ShowFakeObj();
        m_FirstChild.SetActive(true);
        if (Singleton <ObjManager> .GetInstance().MainPlayer != null)
        {
            m_PlayerCombatBuffer = Singleton <ObjManager> .GetInstance().MainPlayer.BaseAttr.CombatValue;
        }

        Check_NewPlayerGuide();

        Init();

#if BOBJOYSTICK
        UIRootJoyControllerHelper.Instance.setState(UIRootJoyControllerHelper.JoyUIState.BAG_UI);
#endif
    }
示例#15
0
        public uint Execute(PacketDistributed ipacket)
        {
            GC_SHOW_EQUIPREMIND packet = (GC_SHOW_EQUIPREMIND)ipacket;

            if (null == packet)
            {
                return((uint)PACKET_EXE.PACKET_EXE_ERROR);
            }
            //enter your logic
            GameItem item = new GameItem();

            item.Guid   = packet.EquipGUID;
            item.DataID = packet.EquipID;
            if (BackPackLogic.Instance() != null)
            {
                if (packet.EquipGUID != BackPackLogic.Instance().TakeOffGuid)
                {
                    EquipRemindLogic.InitEquipInfo(item);
                }
                else
                {
                    BackPackLogic.Instance().TakeOffGuid = GlobeVar.INVALID_GUID;
                }
            }
            else if (RoleViewLogic.Instance() != null)
            {
                if (packet.EquipGUID != RoleViewLogic.Instance().TakeOffGuid)
                {
                    EquipRemindLogic.InitEquipInfo(item);
                }
                else
                {
                    RoleViewLogic.Instance().TakeOffGuid = GlobeVar.INVALID_GUID;
                }
            }
            else
            {
                EquipRemindLogic.InitEquipInfo(item);
            }
            return((uint)PACKET_EXE.PACKET_EXE_CONTINUE);
        }
示例#16
0
 void Check_NewPlayerGuide()
 {
     if (BackPackLogic.Instance() != null)
     {
         int nIndex = BackPackLogic.Instance().NewPlayerGuideFlag_Step;
         if (nIndex == 1)
         {
             NewPlayerGuide(0);
             BackPackLogic.Instance().NewPlayerGuideFlag_Step = -1;
         }
     }
     else if (SysShopController.Instance() != null)
     {
         int nIndex = SysShopController.Instance().NewPlayerGuide_Step;
         if (nIndex == 1)
         {
             NewPlayerGuide(1);
             SysShopController.Instance().NewPlayerGuide_Step = -1;
         }
     }
 }
        public uint Execute(PacketDistributed ipacket)
        {
            GC_COMBATVALUE_RET packet = (GC_COMBATVALUE_RET )ipacket;

            if (null == packet)
            {
                return((uint)PACKET_EXE.PACKET_EXE_ERROR);
            }
            //enter your logic

            if (Singleton <ObjManager> .GetInstance().MainPlayer != null)
            {
                if (packet.ShowPowerRemind == 1)
                {
                    int nNewCombatValue = packet.CombatValue;
                    int nAddCombatValue = nNewCombatValue - Singleton <ObjManager> .GetInstance().MainPlayer.BaseAttr.CombatValue;

                    if (nAddCombatValue > 0)
                    {
                        PowerRemindLogic.InitPowerInfo(nNewCombatValue, nAddCombatValue);
                    }
                }

                Singleton <ObjManager> .GetInstance().MainPlayer.BaseAttr.CombatValue = packet.CombatValue;

                if (BackPackLogic.Instance())
                {
                    //设置了客户端战斗力之后更新背包界面
                    BackPackLogic.Instance().UpdatePlayerInfo();
                }

                if (PVPPowerWindow.Instance())
                {
                    PVPPowerWindow.Instance().UpdateCombatValue();
                }
                if (RoleViewLogic.Instance() != null)
                {
                    RoleViewLogic.Instance().OnCombatChange();
                }
                if (FlyWingRoot.Instance() != null)
                {
                    FlyWingRoot.Instance().SetFlightVlue(packet.CombatValue);
                }
                if (PlayerFrameLogic.Instance())
                {
                    PlayerFrameLogic.Instance().ChangeCombatValue(packet.CombatValue);
                }
            }
            else
            {
                GameManager.gameManager.PlayerDataPool.MainPlayerBaseAttr.CombatValue = packet.CombatValue;
            }
#if UNITY_ANDROID
            // 台湾安卓渠道特有
            if (PlatformHelper.IsChannelTW())
            {
                int newCombatValue = packet.CombatValue;
                // 提交战力排行榜数据
                PlatformHelper.SubmitRankScore(Games.GlobeDefine.GameDefine_Globe.GOOGLEPLAY_RANK_TYPE.COMBAT_VALUE, newCombatValue);
                // 解锁战力成就
                if (newCombatValue >= 1000000)
                {
                    PlatformHelper.UnlockAchievement(Games.GlobeDefine.GameDefine_Globe.GOOGLEPLAY_ACHIEVEMENT_TYPE.COMBAT_VALUE_100);
                }
                else if (newCombatValue >= 700000)
                {
                    PlatformHelper.UnlockAchievement(Games.GlobeDefine.GameDefine_Globe.GOOGLEPLAY_ACHIEVEMENT_TYPE.COMBAT_VALUE_70);
                }
                else if (newCombatValue >= 500000)
                {
                    PlatformHelper.UnlockAchievement(Games.GlobeDefine.GameDefine_Globe.GOOGLEPLAY_ACHIEVEMENT_TYPE.COMBAT_VALUE_50);
                }
                else if (newCombatValue >= 300000)
                {
                    PlatformHelper.UnlockAchievement(Games.GlobeDefine.GameDefine_Globe.GOOGLEPLAY_ACHIEVEMENT_TYPE.COMBAT_VALUE_30);
                }
                else if (newCombatValue >= 200000)
                {
                    PlatformHelper.UnlockAchievement(Games.GlobeDefine.GameDefine_Globe.GOOGLEPLAY_ACHIEVEMENT_TYPE.COMBAT_VALUE_20);
                }
                else if (newCombatValue >= 100000)
                {
                    PlatformHelper.UnlockAchievement(Games.GlobeDefine.GameDefine_Globe.GOOGLEPLAY_ACHIEVEMENT_TYPE.COMBAT_VALUE_10);
                }
                else if (newCombatValue >= 50000)
                {
                    PlatformHelper.UnlockAchievement(Games.GlobeDefine.GameDefine_Globe.GOOGLEPLAY_ACHIEVEMENT_TYPE.COMBAT_VALUE_5);
                }
            }
#endif
            return((uint)PACKET_EXE.PACKET_EXE_CONTINUE);
        }
示例#18
0
        public uint Execute(PacketDistributed ipacket)
        {
            GC_UPDATEITEM packet = (GC_UPDATEITEM)ipacket;

            if (null == packet)
            {
                return((uint)PACKET_EXE.PACKET_EXE_ERROR);
            }
            int packtype  = packet.Packtype;
            int packindex = packet.Packindex;

            GameItemContainer.Type containertype = (GameItemContainer.Type)packtype;
            //取得物品容器
            GameItemContainer Container = GameManager.gameManager.PlayerDataPool.GetItemContainer(containertype);

            if (Container != null)
            {
                //取得物品
                GameItem item = Container.GetItem(packindex);
                if (item != null)
                {
                    int    nRawId    = item.DataID;
                    UInt64 RawGuidID = item.Guid;
                    //ID
                    item.DataID = packet.Dataid;
                    //GUID
                    item.Guid = packet.Guid;
                    //绑定
                    if (packet.HasBindflag)
                    {
                        if (packet.Bindflag == 1)
                        {
                            item.BindFlag = true;
                        }
                        else
                        {
                            item.BindFlag = false;
                        }
                    }
                    else
                    {
                        item.BindFlag = false;
                    }
                    //叠加数量
                    if (packet.HasStackcount)
                    {
                        item.StackCount = packet.Stackcount;
                    }
                    else
                    {
                        item.StackCount = 1;
                    }
                    //创建时间
                    item.CreateTime = packet.Createtime;
                    //强化等级
                    if (packet.HasEnchancelevel)
                    {
                        item.EnchanceLevel = packet.Enchancelevel;
                    }
                    else
                    {
                        item.EnchanceLevel = 0;
                    }
                    //强化经验
                    if (packet.HasEnchanceexp)
                    {
                        item.EnchanceExp = packet.Enchanceexp;
                    }
                    else
                    {
                        item.EnchanceExp = 0;
                    }
                    //强化总经验
                    if (packet.HasEnctotaltexp)
                    {
                        item.EnchanceTotalExp = packet.Enctotaltexp;
                    }
                    else
                    {
                        item.EnchanceTotalExp = 0;
                    }
                    //打星等级
                    if (packet.HasStarlevel)
                    {
                        item.StarLevel = packet.Starlevel;
                    }
                    else
                    {
                        item.StarLevel = 0;
                    }
                    //打星次数
                    if (packet.HasStartimes)
                    {
                        item.StarTimes = packet.Startimes;
                    }
                    else
                    {
                        item.StarTimes = 0;
                    }
                    //动态参数
                    if (packet.HasDynamicdata1)
                    {
                        item.DynamicData[0] = packet.Dynamicdata1;
                    }
                    else
                    {
                        item.DynamicData[0] = 0;
                    }
                    if (packet.HasDynamicdata2)
                    {
                        item.DynamicData[1] = packet.Dynamicdata2;
                    }
                    else
                    {
                        item.DynamicData[1] = 0;
                    }
                    if (packet.HasDynamicdata3)
                    {
                        item.DynamicData[2] = packet.Dynamicdata3;
                    }
                    else
                    {
                        item.DynamicData[2] = 0;
                    }
                    if (packet.HasDynamicdata4)
                    {
                        item.DynamicData[3] = packet.Dynamicdata4;
                    }
                    else
                    {
                        item.DynamicData[3] = 0;
                    }
                    if (packet.HasDynamicdata5)
                    {
                        item.DynamicData[4] = packet.Dynamicdata5;
                    }
                    else
                    {
                        item.DynamicData[4] = 0;
                    }
                    if (packet.HasDynamicdata6)
                    {
                        item.DynamicData[5] = packet.Dynamicdata6;
                    }
                    else
                    {
                        item.DynamicData[5] = 0;
                    }
                    if (packet.HasDynamicdata7)
                    {
                        item.DynamicData[6] = packet.Dynamicdata7;
                    }
                    else
                    {
                        item.DynamicData[6] = 0;
                    }
                    if (packet.HasDynamicdata8)
                    {
                        item.DynamicData[7] = packet.Dynamicdata8;
                    }
                    else
                    {
                        item.DynamicData[7] = 0;
                    }
                    //装备属性浮动参数
                    if (packet.HasAttrfactor)
                    {
                        item.AttrFactor = packet.Attrfactor;
                    }
                    else
                    {
                        item.AttrFactor = GlobeVar.INVALID_ID;
                    }

                    //更新界面
                    switch (containertype)
                    {
                    //物品背包
                    case GameItemContainer.Type.TYPE_BACKPACK:
                    {
                        if (BackPackLogic.Instance() != null)
                        {
                            BackPackLogic.Instance().UpdateBackPack();
                        }

                        //美人提示

                        BelleData.UpdateBelleItemTip(item.DataID, item.StackCount);
                        BelleData.UpdateBelleEvoCountTip(item.DataID, item.StackCount);
                        //宝石界面
                        if (GemLogic.Instance() != null)
                        {
                            GemLogic.Instance().UpdateGemItemList();
                        }
                        //自动选择药
                        if (Singleton <ObjManager> .GetInstance().MainPlayer)
                        {
                            Singleton <ObjManager> .GetInstance().MainPlayer.UpdateSelectDrug();

                            //更新头顶图标信息
                            if (PlayerFrameLogic.Instance())
                            {
                                PlayerFrameLogic.Instance().InitAutoFight();
                            }
                            //自动出售
                            if (item.DataID != -1)
                            {
                                Singleton <ObjManager> .GetInstance().MainPlayer.UpdateSellItem(packindex);
                            }
                        }
                        // 乾坤袋
                        if (QianKunDaiLogic.Instance() != null && QianKunDaiLogic.Instance().gameObject.activeSelf)
                        {
                            QianKunDaiLogic.Instance().HandleUpdateItemPacket();
                        }
                        // 生活技能
                        if (LivingSkillLogic.Instance() != null)
                        {
                            LivingSkillLogic.Instance().HandleUpdateItem();
                        }
                        //仓库界面
                        if (CangKuLogic.Instance() != null)
                        {
                            CangKuLogic.Instance().UpdateBackPack();
                        }
                        //情人节收到的花
//								if (FriendChooseLogic.RoseDataId0 == item.DataID)
//								{
//									if (null != Singleton<ObjManager>.Instance.MainPlayer &&
//							            Singleton<ObjManager>.Instance.MainPlayer.CheckUseItem(item))
//									{
//										Singleton<ObjManager>.Instance.MainPlayer.UseItem(item);
//									}
//
//								}
                        //魅力道具
//                                if (FlowerEggWindow.CHARM_ITEM_ID == item.DataID)
//                                {
//                                    if (null != Singleton<ObjManager>.Instance.MainPlayer &&
//                                        Singleton<ObjManager>.Instance.MainPlayer.CheckUseItem(item))
//                                    {
//                                        Singleton<ObjManager>.Instance.MainPlayer.UseItem(item);
//                                    }
//
//                                }
//                                if (FlowerEggWindow.Instance() != null)
//                                {
//                                    FlowerEggWindow.Instance().UpdateItemNum();
//                                }

                        if (GongZhanTianXiaWindow.Instance() != null &&
                            GlobeVar.ZHANKUANGPAI_DATAID == item.DataID)
                        {
                            GongZhanTianXiaWindow.Instance().UpdateZhanKuangPaiCount();
                        }

                        if (GongJiShopLogic.Instance() != null &&
                            GongJiShopLogic.ConsumItem_DataID == item.DataID)
                        {
                            GongJiShopLogic.Instance().UpDateGongJi();
                        }
                    }
                    break;

                    //装备槽位
                    case GameItemContainer.Type.TYPE_EQUIPPACK:
                    {
                        if (BackPackLogic.Instance() != null)
                        {
                            BackPackLogic.Instance().UpdateEquipPack();
                        }
                        if (RoleViewLogic.Instance() != null)
                        {
                            RoleViewLogic.Instance().UpdateEquipPack();
                        }
                        //自动强化装备选择
                        if (Singleton <ObjManager> .GetInstance().MainPlayer &&
                            VipData.GetVipLv() >= GlobeVar.USE_AUTOFIGHT_VIPLEVEL &&
                            Singleton <ObjManager> .GetInstance().MainPlayer.BaseAttr.Level >= GlobeVar.MAX_AUTOEQUIT_LIVE)
                        {
                            if (RawGuidID == Singleton <ObjManager> .GetInstance().MainPlayer.AutoEquipGuid)
                            {
                                if (item.IsValid())
                                {
                                    Singleton <ObjManager> .GetInstance().MainPlayer.AutoEquipGuid = item.Guid;
                                }
                                else
                                {
                                    Singleton <ObjManager> .GetInstance().MainPlayer.AutoEquipGuid = GlobeVar.INVALID_GUID;

                                    Singleton <ObjManager> .GetInstance().MainPlayer.UpdateSelectEquip();
                                }
                            }
                        }
                        //神器强化界面
                        if (EquipShenQiStrength.Instance() != null)
                        {
                            EquipShenQiStrength.Instance().UpdateShenQiViewInfo();
                        }
                    }
                    break;

                    case GameItemContainer.Type.TYPE_BUYBACKPACK:
                    {
                        SysShopController sysShop = UIControllerBase <SysShopController> .Instance();

                        if (sysShop != null)
                        {
                            sysShop.UpdateBuyBackItems();
                        }
                    }
                    break;
                    }
                    ;
                }
            }
            //enter your logic
            return((uint)PACKET_EXE.PACKET_EXE_CONTINUE);
        }
示例#19
0
 void Awake()
 {
     m_Instance = this;
     m_TabController.delTabChanged = OnClickFilter;
 }
示例#20
0
        public uint Execute(PacketDistributed ipacket)
        {
            GC_SYN_ATTR packet = (GC_SYN_ATTR)ipacket;

            if (null == packet)
            {
                return((uint)PACKET_EXE.PACKET_EXE_ERROR);
            }
            //enter your logic
            //判断是MainPlayer还是其他Obj
            Obj_MainPlayer _mainPlayer = Singleton <ObjManager> .GetInstance().MainPlayer;

            PlayerData playerDataPool = GameManager.gameManager.PlayerDataPool;

            //血量
            bool isHpChange = false;

            if (packet.HasCurHp)
            {
                playerDataPool.MainPlayerBaseAttr.HP = packet.CurHp;
                isHpChange = true;
            }
            if (packet.HasMaxHP)
            {
                playerDataPool.MainPlayerBaseAttr.MaxHP = packet.MaxHP;
#if UNITY_ANDROID
                // 台湾安卓渠道特有,提交血量排行榜数据
                if (PlatformHelper.IsChannelTW())
                {
                    PlatformHelper.SubmitRankScore(Games.GlobeDefine.GameDefine_Globe.GOOGLEPLAY_RANK_TYPE.HP, playerDataPool.MainPlayerBaseAttr.MaxHP);
                }
#endif
                isHpChange = true;
            }
            if (isHpChange && _mainPlayer != null)
            {
                _mainPlayer.OptHPChange();
            }
            //法力
            bool isMpChange = false;
            if (packet.HasCurMp)
            {
                playerDataPool.MainPlayerBaseAttr.MP = packet.CurMp;
                isMpChange = true;
            }
            if (packet.HasMaxMP)
            {
                playerDataPool.MainPlayerBaseAttr.MaxMP = packet.MaxMP;
                isMpChange = true;
            }
            if (isMpChange && _mainPlayer != null)
            {
                _mainPlayer.OptMPChange();
            }

            //怒气
            bool isXpChange = false;
            if (packet.HasCurXp)
            {
                playerDataPool.MainPlayerBaseAttr.XP = packet.CurXp;
                isXpChange = true;
            }
            if (packet.HasMaxXP)
            {
                playerDataPool.MainPlayerBaseAttr.MaxXP = packet.MaxXP;
                isXpChange = true;
            }
            if (isXpChange && _mainPlayer != null)
            {
                _mainPlayer.OptXPChange();
            }

            //等级
            if (packet.HasCurLev)
            {
                // 更新配置文件

                playerDataPool.MainPlayerBaseAttr.Level = packet.CurLev;
                if (_mainPlayer)
                {
                    for (int i = 0; i < LoginData.loginRoleList.Count; i++)
                    {
                        if (LoginData.loginRoleList[i].guid == _mainPlayer.GUID)
                        {
                            LoginData.loginRoleList[i].level = packet.CurLev;
                            UserConfigData.AddRoleInfo();
                            break;
                        }
                    }

                    _mainPlayer.OptLevelChange();

                    if (LivingSkillLogic.Instance() != null)
                    {
                        LivingSkillLogic.Instance().UpdatePlayerStamina();
                    }
                    _mainPlayer.UpdateSelectDrug();
                }
            }
            // 经验
            if (packet.HasCurExp)
            {
                playerDataPool.MainPlayerBaseAttr.Exp = packet.CurExp;
                if (_mainPlayer)
                {
                    _mainPlayer.OnExpChange();
                }
                //神器强化界面
                if (EquipShenQiStrength.Instance() != null)
                {
                    EquipShenQiStrength.Instance().UpdateExpShow();
                }
            }
            if (packet.HasOffLineExp)
            {
                playerDataPool.MainPlayerBaseAttr.OffLineExp = packet.OffLineExp;
                if (null != _mainPlayer)
                {
                    _mainPlayer.OnOffLineExpChange();
                }
            }
            //体能
            if (packet.HasCurStamina)
            {
                playerDataPool.MainPlayerBaseAttr.CurStamina = packet.CurStamina;

                if (LivingSkillLogic.Instance() != null)
                {
                    LivingSkillLogic.Instance().UpdatePlayerStamina();
                }
            }
            //金钱
            if (packet.HasCurMoney)
            {
                playerDataPool.Money.SetMoney(MONEYTYPE.MONEYTYPE_COIN, packet.CurMoney);
#if UNITY_ANDROID
                // 台湾安卓渠道特有,提交金币排行榜数据
                if (PlatformHelper.IsChannelTW())
                {
                    PlatformHelper.SubmitRankScore(Games.GlobeDefine.GameDefine_Globe.GOOGLEPLAY_RANK_TYPE.GOLD_COINS, packet.CurMoney);
                }
#endif
                if (BackPackLogic.Instance())
                {
                    BackPackLogic.Instance().UpdateMoneyInfo();
                }

                if (FlyWingRoot.Instance())
                {
                    FlyWingRoot.Instance().UpdateMoneyInfo();
                }
//                if (SwordsManController.Instance() != null)
//                {
//                    SwordsManController.Instance().UpdateCoin();
//                }
                if (CangKuLogic.Instance())
                {
                    CangKuLogic.Instance().UpdateBackPack_Money();
                }
                //神器强化界面
                if (EquipShenQiStrength.Instance() != null)
                {
                    EquipShenQiStrength.Instance().UpdateMoneyShow();
                }
                if (GemLogic.Instance() != null)
                {
                    GemLogic.Instance().UpdateMoneyInfo();
                }
                if (null != GUIData.delMoneyChanged)
                {
                    GUIData.delMoneyChanged();
                }

                if (RestaurantController.Instance() != null)
                {
                    RestaurantController.Instance().UpdateMoneyInfo();
                }

                if (EquipStrengthenLogic.Instance() != null)
                {
                    EquipStrengthenLogic.Instance().UpdateMoneyInfo();
                }

                if (SkillLevelUpRoot.Instance() != null)
                {
                    SkillLevelUpRoot.Instance().UpdateSkillInfo();
                }
            }

            //元宝
            if (packet.HasCurYuanBao)
            {
                playerDataPool.Money.SetMoney(MONEYTYPE.MONEYTYPE_YUANBAO, packet.CurYuanBao);
                if (BackPackLogic.Instance())
                {
                    BackPackLogic.Instance().UpdateMoneyInfo();
                }
                if (YuanBaoShopLogic.Instance())
                {
                    YuanBaoShopLogic.Instance().UpdateYuanBaoInfo();
                }
                if (DailyLuckyDrawLogic.Instance())
                {
                    DailyLuckyDrawLogic.Instance().UpdateMoney();
                }
                if (CangKuLogic.Instance())
                {
                    CangKuLogic.Instance().UpdateBackPack_Money();
                }
                //神器强化界面
                if (EquipShenQiStrength.Instance() != null)
                {
                    EquipShenQiStrength.Instance().UpdateMoneyShow();
                }
                if (null != GUIData.delMoneyChanged)
                {
                    GUIData.delMoneyChanged();
                }
            }

            //绑定元宝
            if (packet.HasCurBDYuanBao)
            {
                playerDataPool.Money.SetMoney(MONEYTYPE.MONEYTYPE_YUANBAO_BIND, packet.CurBDYuanBao);
                if (FashionLogic.Instance() != null)
                {
                    FashionLogic.Instance().UpdateRuby();
                }
                if (BackPackLogic.Instance())
                {
                    BackPackLogic.Instance().UpdateMoneyInfo();
                }
                if (YuanBaoShopLogic.Instance())
                {
                    YuanBaoShopLogic.Instance().UpdateYuanBaoInfo();
                }
                if (DailyLuckyDrawLogic.Instance())
                {
                    DailyLuckyDrawLogic.Instance().UpdateMoney();
                }
                if (CangKuLogic.Instance())
                {
                    CangKuLogic.Instance().UpdateBackPack_Money();
                }
                if (RestaurantController.Instance() != null)
                {
                    RestaurantController.Instance().UpdateMoneyInfo();
                }
                if (null != GUIData.delMoneyChanged)
                {
                    GUIData.delMoneyChanged();
                }
            }
//            if (packet.HasSwordsManScore)
//            {
//                playerDataPool.SwordsManScore = packet.SwordsManScore;
//                if (SwordsManController.Instance() != null)
//                {
//                    SwordsManController.Instance().UpdateSwordsManScore();
//                }
//            }

            if (packet.HasReputation)
            {
                playerDataPool.Reputation = packet.Reputation;
            }

            //是否在战斗状态
            if (packet.HasIsInCombat && _mainPlayer != null)
            {
                bool oldCombat = _mainPlayer.InCombat;
                _mainPlayer.InCombat = (packet.IsInCombat == 1 ? true:false);
                if (!_mainPlayer.InCombat && oldCombat)
                {
                    _mainPlayer.LastLeaveCombatTime = Time.time;
                }
                else if (_mainPlayer.InCombat && !oldCombat)
                {
                    _mainPlayer.LastLeaveCombatTime = 0.0f;
                }
            }
            //经验 血 蓝 变化时 更新主角属性界面
            if (packet.HasCurHp || packet.HasCurMp || packet.HasCurExp)
            {
                if (RoleViewLogic.Instance() != null)
                {
                    RoleViewLogic.Instance().UpdateCurAttr();
                }
            }

            if (packet.HasGuildDKP)
            {
                playerDataPool.GuildDKP = packet.GuildDKP;
                if (GuildShopLogic.Instance() != null)
                {
                    GuildShopLogic.Instance().UpdateGuildDKP();
                }
            }
            return((uint)PACKET_EXE.PACKET_EXE_CONTINUE);
        }