public void ResetFitOn()
 {
     if (null != m_PlayerFakeObj && null != m_PlayerFakeObj.ObjAnim)
     {
         m_PlayerFakeObj.initFakeObject(m_PlayerFakeObjID, GameManager.gameManager.ActiveScene.FakeObjTrans, out m_FakeObjGameObject);
         m_ModelDrag.ModelTrans = m_PlayerFakeObj.ObjAnim.transform;
         if (null != FashionLogic.Instance())
         {
             FashionLogic.Instance().IsFitOn = false;
         }
     }
 }
 public void TitleBtClick()
 {
     ChooseTabButton(CONTENT_TYPE.CONTENT_TYPE_TITLE);
     m_AttrView.SetActive(false);
     m_TitleView.SetActive(true);
     m_LeftView.SetActive(false);
     GameManager.gameManager.ActiveScene.HideFakeObj();
     if (FashionLogic.Instance() != null && FashionLogic.Instance().IsFitOn)
     {
         ResetFitOn();
     }
 }
    public void HandleItemChoose()
    {
        int curChooseFashionType = TableManager.GetFashionDataByID(m_FashionID, 0).FashionType;

        if (FashionLogic.Instance() != null)
        {
            FashionLogic.Instance().ChooseFashionItem(m_FashionID);
            if (curChooseFashionType == (int)FashionLogic.FashionType.TYPE_ClOSETH)
            {
                FashionLogic.Instance().FitOnFashion(m_FashionID);
            }
            else if (curChooseFashionType == (int)FashionLogic.FashionType.TYPE_WING)
            {
                FashionLogic.Instance().FitOnWing();
            }
        }
    }
        public uint Execute(PacketDistributed ipacket)
        {
            GC_SEND_FASHIONINFO packet = (GC_SEND_FASHIONINFO )ipacket;

            if (null == packet)
            {
                return((uint)PACKET_EXE.PACKET_EXE_ERROR);
            }
            //enter your logic
            GameManager.gameManager.PlayerDataPool.FashionDeadline[packet.FashionID] = packet.Deadline;
            if (FashionLogic.Instance() != null)
            {
                FashionLogic.Instance().HandleSendFashionInfo(packet.FashionID);
            }

            return((uint)PACKET_EXE.PACKET_EXE_CONTINUE);
        }
        public uint Execute(PacketDistributed ipacket)
        {
            GC_SEND_CURFASHION packet = (GC_SEND_CURFASHION )ipacket;

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

            // 改本消息包为单纯给玩家自己同步当前时装ID 不广播
            if (FashionLogic.Instance() != null)
            {
                FashionLogic.Instance().HandleSendCurFashion(packet.CurFashionID);
            }

            return((uint)PACKET_EXE.PACKET_EXE_CONTINUE);
        }
        public uint Execute(PacketDistributed ipacket)
        {
            GC_EQUIPFLYWING_RESULT packet = (GC_EQUIPFLYWING_RESULT )ipacket;

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

            if (packet.FlyWingType == (int)GlobeVar.FLY_SOCKET_TYPE.FLY_SOCKET_ACQUIRE)
            {
                if (packet.HasFlyWingId1)
                {
                    GameManager.gameManager.FlyWingMananger.addFlyWingData(packet.FlyWingId1);
                }
            }

            else if (packet.FlyWingType == (int)GlobeVar.FLY_SOCKET_TYPE.FLY_SOCKET_ACQUIRE_DREAM)
            {
                if (packet.HasFlyWingId1)
                {
                    GameManager.gameManager.FlyWingMananger.addDreamFlyWingData(packet.FlyWingId1);
                }
            }
            else if (packet.FlyWingType == (int)GlobeVar.FLY_SOCKET_TYPE.FLY_SOCKET_DREAM)
            {
                if (packet.HasFlyWingId1)
                {
                    GameManager.gameManager.FlyWingMananger.DreamFlyWing(packet.FlyWingId1);
                    if (FashionLogic.Instance() != null)
                    {
                        FashionLogic.Instance().UpdateCurChooseFashion();
                    }
                }
            }

            else if (packet.FlyWingType == (int)GlobeVar.FLY_SOCKET_TYPE.FLY_SOCKET_CANCEL_DREAM)
            {
                GameManager.gameManager.FlyWingMananger.CancelDreamFlyWing();
                if (FashionLogic.Instance() != null)
                {
                    FashionLogic.Instance().UpdateCurChooseFashion();
                }
            }

            else if (packet.FlyWingType == (int)GlobeVar.FLY_SOCKET_TYPE.FLY_SOCKET_EQUIP)
            {
                if (packet.HasFlyWingId1)
                {
                    GameManager.gameManager.FlyWingMananger.EquipFlyWing(packet.FlyWingId1);
                }
            }

            else if (packet.FlyWingType == (int)GlobeVar.FLY_SOCKET_TYPE.FLY_SOCKET_UNEQUIP)
            {
                GameManager.gameManager.FlyWingMananger.CanceEquipFlyWing();
            }

            else if (packet.FlyWingType == (int)GlobeVar.FLY_SOCKET_TYPE.FLY_SOCKET_ABSORT)
            {
                if (packet.HasFlyWingId1 && packet.HasFlyWingId2)
                {
                    GameManager.gameManager.FlyWingMananger.AbsortFlyWingData(packet.FlyWingId1, packet.FlyWingId2);
                }
            }
            else if (packet.FlyWingType == (int)GlobeVar.FLY_SOCKET_TYPE.FLY_SOCKET_ADVANCE)
            {
                if (packet.HasFlyWingId1 && packet.HasFlyWingId2)
                {
                    GameManager.gameManager.FlyWingMananger.AdvanceFlyWing(packet.FlyWingId1, packet.FlyWingId2);
                }
            }
            else if (packet.FlyWingType == (int)GlobeVar.FLY_SOCKET_TYPE.FLY_SOCKET_SHOWHIDE)
            {
                if (packet.HasFlyWingId1)
                {
                    if (packet.FlyWingId1 == 1)
                    {
                        GameManager.gameManager.FlyWingMananger.ShowHideFlyWing(true);
                    }
                    else if (packet.FlyWingId1 == 0)
                    {
                        GameManager.gameManager.FlyWingMananger.ShowHideFlyWing(false);
                    }
                }
            }
            else if (packet.FlyWingType == (int)GlobeVar.FLY_SOCKET_TYPE.FLY_SOCKET_OTHER_PLAYER)
            {
                if (packet.HasFlyWingId1 && packet.HasFlyWingId2)
                {
                    int nObjServerID = packet.FlyWingId1;
                    if (nObjServerID != GameManager.gameManager.PlayerDataPool.EnterSceneCache.EnterSceneServerID)
                    {
                        Obj_Character obj = Singleton <ObjManager> .GetInstance().FindObjCharacterInScene(nObjServerID);

                        if (obj.ObjType == Games.GlobeDefine.GameDefine_Globe.OBJ_TYPE.OBJ_OTHER_PLAYER)
                        {
                            Obj_OtherPlayer Player = obj as Obj_OtherPlayer;
                            if (Player)
                            {
                                Player.OtherPlayerFlyWingModelId = packet.FlyWingId2;

                                if (Player.OtherPlayerFlyWingModelId == GlobeVar.INVALID_ID)
                                {
                                    Player.DestroyFlyWingObj();
                                }
                                else
                                {
                                    Player.RealoadPlayerFlyWingModel();
                                }
                            }
                        }
                    }
                }
            }

            else if (packet.FlyWingType == (int)GlobeVar.FLY_SOCKET_TYPE.FLY_SOCKET_CLEAN_ALL_DATA)
            {
                GameManager.gameManager.FlyWingMananger.CleanAllFlyWingData();
            }
            else if (packet.FlyWingType == (int)GlobeVar.FLY_SOCKET_TYPE.FLY_SOCKET_UNACQUIRE)
            {
                if (packet.HasFlyWingId1)
                {
                    GameManager.gameManager.FlyWingMananger.delDreamFlyWingData(packet.FlyWingId1);
                }
            }

            return((uint)PACKET_EXE.PACKET_EXE_CONTINUE);
        }
        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);
        }
Exemple #8
0
 public void HandleSendCurFashion(int nCurFashionID)
 {
     GameManager.gameManager.PlayerDataPool.CurFashionID = nCurFashionID;
     FashionLogic.Instance().UpdateCurChooseFashion();
 }