コード例 #1
0
    void OnBtnServerOther()
    {
        //PlayerPreferenceData.ClientLoginCount = PlayerPreferenceData.ClientLoginCount + 1;
        UIControllerBase <ServerChooseController> .Instance().SwitchWindow((int)ServerChooseController.Window.ServerList);

        ServerChooseController.Instance().hideGroundPic();
    }
コード例 #2
0
ファイル: FakeObject.cs プロジェクト: kimch2/PackageClient
        private void LoadWeapon(GameObject Obj, string szBindPoint, string szResName, Tab_WeaponModel tabWeaponModel)
        {
            List <object> param = new List <object>();

            if (Singleton <ObjManager> .Instance.MainPlayer != null)
            {
                param.Add(szBindPoint);
                param.Add(Singleton <ObjManager> .Instance.MainPlayer.WeaponEffectGem);
                param.Add(null);
                param.Add(Singleton <ObjManager> .Instance.MainPlayer.Profession);
                param.Add(Singleton <ObjManager> .Instance.MainPlayer.CurWeaponDataID);
                if (szBindPoint == "Weapon_L")
                {
                    param.Add(new Vector3(tabWeaponModel.LeftRotX, tabWeaponModel.LeftRotY, tabWeaponModel.LeftRotZ));
                }
                else if (szBindPoint == "Weapon_R")
                {
                    param.Add(new Vector3(tabWeaponModel.RightRotX, tabWeaponModel.RightRotY, tabWeaponModel.RightRotZ));
                }
                param.Add(tabWeaponModel);
                Singleton <ObjManager> .GetInstance().ReloadWeapon(Obj, szResName, Singleton <ObjManager> .GetInstance().AsycReloadWeaponOver, param);
            }

            else
            {
                if (UIControllerBase <RoleChooseLogic> .Instance() != null)
                {
                    param.Add(szBindPoint);
                    param.Add(-1);
                    param.Add(null);
                    param.Add(UIControllerBase <RoleChooseLogic> .Instance().GetRoleProfess());
                    param.Add(-1);

                    if (szBindPoint == "Weapon_L")
                    {
                        param.Add(new Vector3(tabWeaponModel.LeftRotX, tabWeaponModel.LeftRotY, tabWeaponModel.LeftRotZ));
                    }
                    else if (szBindPoint == "Weapon_R")
                    {
                        param.Add(new Vector3(tabWeaponModel.RightRotX, tabWeaponModel.RightRotY, tabWeaponModel.RightRotZ));
                    }

                    param.Add(tabWeaponModel);

                    Singleton <ObjManager> .GetInstance().ReloadWeapon(Obj, szResName, Singleton <ObjManager> .GetInstance().AsycReloadWeaponOver, param);
                }
            }
        }
コード例 #3
0
    public void ServerSelected(string name)
    {
        for (int i = 0; i < m_itemList.Count; ++i)
        {
            bool bHightLight = m_itemList[i].name == name;
            m_itemList[i].GetComponent <ServerListItem>().EnableHeightLight(bHightLight);
        }
        m_curSelectItemName = name;

        int curID = 0;

        if (int.TryParse(name, out curID))
        {
            for (int i = 0; i < LoginData.serverListData.Count; ++i)
            {
                if (LoginData.serverListData[i].m_id == curID)
                {
                    UIControllerBase <ServerChooseController> .Instance().SelectServerListItem(LoginData.serverListData[i]);
                }
            }
        }
    }
コード例 #4
0
ファイル: FakeObject.cs プロジェクト: kimch2/PackageClient
        public void InitFakeObjWeapon(GameObject Obj, int nCurWeaponID, Tab_FakeObject FakeObjTable)
        {
            // 重载武器
            bool           defaultVisual = false;
            Tab_ItemVisual WeaponVisual  = null;
            Tab_EquipAttr  tabEquipAttr  = TableManager.GetEquipAttrByID(nCurWeaponID, 0);

            if (tabEquipAttr != null)
            {
                Tab_ItemVisual tabWeaponVisual = TableManager.GetItemVisualByID(tabEquipAttr.ModelId, 0);
                if (tabWeaponVisual != null)
                {
                    WeaponVisual = tabWeaponVisual;
                }
                else
                {
                    defaultVisual = true;
                }
            }
            else
            {
                defaultVisual = true;
            }

            if (defaultVisual)
            {
                Tab_ItemVisual tabDefaultVisual = TableManager.GetItemVisualByID(GlobeVar.DEFAULT_VISUAL_ID, 0);
                if (tabDefaultVisual == null)
                {
                    return;
                }

                WeaponVisual = tabDefaultVisual;
            }

            int nWeaponModelID = -1;

            if (WeaponVisual == null)
            {
                return;
            }


            if (Singleton <ObjManager> .Instance.MainPlayer == null)
            {
                if (UIControllerBase <RoleChooseLogic> .Instance() != null)
                {
                    int nProfession = -1;
                    nProfession = UIControllerBase <RoleChooseLogic> .Instance().GetRoleProfess();

                    if (nProfession == (int)CharacterDefine.PROFESSION.SHAOLIN)
                    {
                        nWeaponModelID = WeaponVisual.WeaponModelIDShaoLin;
                    }
                    else if (nProfession == (int)CharacterDefine.PROFESSION.TIANSHAN)
                    {
                        nWeaponModelID = WeaponVisual.WeaponModelIDTianShan;
                    }
                    else if (nProfession == (int)CharacterDefine.PROFESSION.DALI)
                    {
                        nWeaponModelID = WeaponVisual.WeaponModelIDDaLi;
                    }
                    else if (nProfession == (int)CharacterDefine.PROFESSION.XIAOYAO)
                    {
                        nWeaponModelID = WeaponVisual.WeaponModelIDXiaoYao;
                    }
                    else if (nProfession == (int)CharacterDefine.PROFESSION.GAIBANG)
                    {
                        nWeaponModelID = WeaponVisual.WeaponModelIDGaiBang;
                    }
                }
            }

            else
            {
                nWeaponModelID = Singleton <ObjManager> .Instance.MainPlayer.GetWeaponModelID(WeaponVisual);
            }


            Tab_WeaponModel tabWeaponModel = TableManager.GetWeaponModelByID(nWeaponModelID, 0);

            if (tabWeaponModel == null)
            {
                return;
            }

            int playerProfession = -1;

            if (Singleton <ObjManager> .Instance.MainPlayer == null)
            {
                if (UIControllerBase <RoleChooseLogic> .Instance())
                {
                    playerProfession = UIControllerBase <RoleChooseLogic> .Instance().GetRoleProfess();
                }
            }

            else
            {
                playerProfession = Singleton <ObjManager> .Instance.MainPlayer.Profession;
            }

            if (playerProfession == (int)CharacterDefine.PROFESSION.TIANSHAN ||
                playerProfession == (int)CharacterDefine.PROFESSION.GAIBANG)
            {
                LoadWeapon(Obj, "Weapon_L", tabWeaponModel.ResPath + "_L", tabWeaponModel);
                LoadWeapon(Obj, "Weapon_R", tabWeaponModel.ResPath + "_R", tabWeaponModel);
            }
            else if (playerProfession == (int)CharacterDefine.PROFESSION.XIAOYAO)
            {
                LoadWeapon(Obj, "Weapon_R", tabWeaponModel.ResPath + "_R", tabWeaponModel);
            }
            else
            {
                LoadWeapon(Obj, "Weapon_R", tabWeaponModel.ResPath + "_R", tabWeaponModel);
            }
        }
コード例 #5
0
    void OnBtnBackClick()
    {
        UIControllerBase <ServerChooseController> .Instance().SwitchWindow((int)ServerChooseController.Window.ServerTop);

        ServerChooseController.Instance().showGroundPic();
    }
コード例 #6
0
 void OnSelectPageClick()
 {
     UIControllerBase <ServerListWindow> .Instance().ServerPageSelected(gameObject.name);
 }
コード例 #7
0
    void OnSelectServerClick()
    {
        UIControllerBase <ServerListWindow> .Instance().ServerSelected(gameObject.name);

        ServerChooseController.Instance().showGroundPic();
    }
コード例 #8
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);
        }