Пример #1
0
        public uint Execute(PacketDistributed ipacket)
        {
            GC_EQUIP_ENCHANCE_RET packet = (GC_EQUIP_ENCHANCE_RET)ipacket;

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

//            int success = packet.Success;
//            int packType = packet.Packtype;
//            UInt64 equipGuid = packet.Equipguid;

            //Ç¿»¯½çÃæ
            if (EquipStrengthenLogic.Instance() != null)
            {
                if (EquipStrengthenLogic.Instance().IsCurEnchanceTab())
                {
                    EquipStrengthenLogic.Instance().UpdateTab();
                    EquipStrengthenLogic.Instance().EnchanceOK();
                }
            }

            //enter your logic
            return((uint)PACKET_EXE.PACKET_EXE_CONTINUE);
        }
 public void ClearSTATUS()
 {
     m_Status = Status.STATUS_ENABLE;
     SetStackCount(m_item);
     EquipStrengthenLogic.Instance().CloseItemInfoObj();
     EquipStrengthenLogic.Instance().ItemAfterCancel_Enchance_Metarial(m_item);
 }
Пример #3
0
    public void UpdateSelectedEquip(string choose, string icon, string quality, int index)
    {
        m_SelectedEquipChoose.gameObject.SetActive(true);
        m_SelectedEquipIcon.gameObject.SetActive(true);
        m_SelectedEquipQuality.gameObject.SetActive(EquipStrengthenLogic.Instance().m_Equip_QualityFrame[index].gameObject.activeSelf);

        m_SelectedEquipChoose.spriteName  = choose;
        m_SelectedEquipIcon.spriteName    = icon;
        m_SelectedEquipQuality.spriteName = quality;
    }
 public void OnDisable()
 {
     //在隐藏的时候把item变为可点击状态,即不选中了
     if (m_item != null)
     {
         Enable();
         SetStackCount(m_item);                                                     //然后设置个数
         EquipStrengthenLogic.Instance().ItemAfterCancel_Enchance_Metarial(m_item); //执行不选中item的操作
     }
 }
Пример #5
0
 void OnShowEquipEnchance(bool bSuccess, object param)
 {
     if (m_Equip != null && m_Equip.IsValid())
     {
         if (EquipStrengthenLogic.Instance() != null)
         {
             //设置勾选当前装备
             EquipStrengthenLogic.Instance().SetCurSelectEquip(m_Equip);
             EquipStrengthenLogic.Instance().UpdateTab();
         }
     }
 }
        public uint Execute(PacketDistributed ipacket)
        {
            GC_EQUIP_STAR_RET packet = (GC_EQUIP_STAR_RET)ipacket;

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

            int success = packet.Success;

//            int packType = packet.Packtype;
//            UInt64 equipGuid = packet.Equipguid;

            //强化界面
            if (EquipStrengthenLogic.Instance() != null)
            {
                EquipStrengthenLogic.Instance().UpdateTab();
                EquipStrengthenLogic.Instance().StarOK();
            }

            if (success == 1)
            {
                //打星成功
                Singleton <ObjManager> .GetInstance().MainPlayer.SendNoticMsg(false, "#{1276}");
            }
            else if (success == 2)
            {
                //星级已满
                Singleton <ObjManager> .GetInstance().MainPlayer.SendNoticMsg(false, "#{1274}");
            }
            else if (success == 3)
            {
                //打星石数量不足
                Singleton <ObjManager> .GetInstance().MainPlayer.SendNoticMsg(false, "#{1275}");
            }
            else if (success == 4)
            {
                //金币不足
                Singleton <ObjManager> .GetInstance().MainPlayer.SendNoticMsg(false, "#{1019}");
            }
            else
            {
                //打星失败
                Singleton <ObjManager> .GetInstance().MainPlayer.SendNoticMsg(false, "#{1277}");
            }

            //enter your logic
            return((uint)PACKET_EXE.PACKET_EXE_CONTINUE);
        }
Пример #7
0
    void LoadEquipStrength(bool bSuccess, object param)
    {
        if (EquipStrengthenLogic.Instance() != null)
        {
            int type = (int)param;
            //EquipStrengthenLogic.Instance().SetAfterDeldegate(type);
            switch (type)
            {
            case 1:
                EquipStrengthenLogic.Instance().m_TabController.ChangeTab("Button1-Strengthen");
                break;

            case 2:
                EquipStrengthenLogic.Instance().m_TabController.ChangeTab("Button2-Star");
                break;
            }
        }
    }
    // 新手指引
    void Check_NewPlayerguide()
    {
        if (gameObject.name != "1000")
        {
            return;
        }

        if (EquipStrengthenLogic.Instance() == null)
        {
            return;
        }
        int nIndex = EquipStrengthenLogic.Instance().NewPlayerGuideFlag_Step;

        if (nIndex == 1)
        {
            NewPlayerGuide(0);
            EquipStrengthenLogic.Instance().NewPlayerGuideFlag_Step = -1;
        }
    }
        public uint Execute(PacketDistributed ipacket)
        {
            GC_RET_EQUIPBACK_GEM_COMBINE packet = (GC_RET_EQUIPBACK_GEM_COMBINE )ipacket;

            if (null == packet)
            {
                return((uint)PACKET_EXE.PACKET_EXE_ERROR);
            }
            if (GemLogic.Instance() != null)
            {
                GemLogic.Instance().UpdateGemSlot();
            }

            if (EquipStrengthenLogic.Instance() != null)
            {
                EquipStrengthenLogic.Instance().RefreshGemsInEquips();
            }
            //enter your logic
            return((uint)PACKET_EXE.PACKET_EXE_CONTINUE);
        }
Пример #10
0
    void OnDisable()
    {
        m_Instance            = null;
        m_NewPlayerGuide_Step = -1;
        //关闭界面时 如果有延迟发包 则直接发包
        if (m_Delay_Time > 0)
        {
            CG_PUT_GEM gemPacket = (CG_PUT_GEM)PacketDistributed.CreatePacket(MessageID.PACKET_CG_PUT_GEM);
            gemPacket.SetEquipslot(m_Delay_CurEquipSlot);
            gemPacket.SetIndex(m_Delay_CurGemSlot);
            gemPacket.SetItemguid(m_Delay_GemGuid);
            gemPacket.SendPacket();

            m_Delay_CurEquipSlot = 0;
            m_Delay_CurGemSlot   = 0;
            m_Delay_GemGuid      = 0;
        }

        //关闭界面时 如果有UI特效播放 则关闭特效
        if (BackCamerControll.Instance())
        {
            BackCamerControll.Instance().StopSceneEffect(133, true);
        }

        CancelInvoke("SlowUpdate");
        if (m_RuneAbsorb != null)
        {
            m_RuneAbsorb.SetActive(false);
        }
        if (EquipStrengthenLogic.Instance() != null)
        {
            EquipStrengthenLogic.Instance().ClearGemsInEquips();
        }
        if (EquipStrengthenLogic.Instance() != null)
        {
            EquipStrengthenLogic.Instance().ReSelectEquip();
        }
    }
Пример #11
0
    void OnEnable()
    {
        m_Instance = this;

        /*deleOnClickGems[0] = OnClickGemItem1;
        *  deleOnClickGems[1] = OnClickGemItem2;
        *  deleOnClickGems[2] = OnClickGemItem3;
        *  deleOnClickGems[3] = OnClickGemItem4;
        *  deleOnClickGems[4] = OnClickGemItem5;
        *  deleOnClickGems[5] = OnClickGemItem6;
        *  deleOnClickGems[6] = OnClickGemItem7;
        *  deleOnClickGems[7] = OnClickGemItem8;*/
        InvokeRepeating("SlowUpdate", 0f, 0.3f);
        InitEmpty();
        updateGemRemindPoint();
        if (EquipStrengthenLogic.Instance() != null)
        {
            if (EquipStrengthenLogic.Instance().NewPlayerGuideFlag_Step == 15)
            {
                NewPlayerGuide(0);
                EquipStrengthenLogic.Instance().NewPlayerGuideFlag_Step = -1;
            }
        }
    }
 public void SetSelectedCount(int count)
 {
     selectedCount         = count;
     m_itemStackCount.text = selectedCount + "/" + m_item.StackCount;
     EquipStrengthenLogic.Instance().ItemAfterChoose_Enchance_Metarial(m_item);
 }
    //点击选择装备
    public void OnClickChooseItem()
    {
        if (m_item == null)
        {
            return;
        }
        if (EquipStrengthenLogic.Instance() == null)
        {
            return;
        }

        if (EquipStrengthenLogic.Instance() != null)
        {
            GameItem curEquip = EquipStrengthenLogic.Instance().GetCurSelectEquip();
            if (curEquip != null)
            {
                if (curEquip.EnchanceLevel >= GlobeVar.EQUIP_ENCHANCE_MAX_LEVEL)
                {
                    //装备强化满级时 不可选择玄铁
                    if (m_item.IsEnchanceExpItem())
                    {
                        GUIData.AddNotifyData2Client(false, "#{4667}");
                        return;
                    }
                }
            }
        }
        if (m_Status == Status.STATUS_DISABLE)
        {
            Singleton <ObjManager> .GetInstance().MainPlayer.SendNoticMsg(false, "#{1271}");
        }

        //改变点击状态
        ChangeClickStatus();

        if (m_Status == Status.STATUS_CHOOSED)
        {
            if (EquipStrengthenLogic.Instance().Get_m_bSetItemCount())
            {
                SetSelectedCount(1);
            }
            else
            {
                EquipStrengthenLogic.Instance().ShowItemInfoObj(this);
                //EquipStrengthenLogic.Instance().ItemAfterChoose_Enchance_Metarial(m_item);
            }
        }
        else if (m_Status == Status.STATUS_ENABLE)
        {
            SetStackCount(m_item);
            EquipStrengthenLogic.Instance().CloseItemInfoObj();
            EquipStrengthenLogic.Instance().ItemAfterCancel_Enchance_Metarial(m_item);
        }

        // 新手指引
        else if (m_NewPlayerGuideFlag_Step == 0)
        {
            EquipStrengthenLogic.Instance().NewPlayerGuide(2);
            m_NewPlayerGuideFlag_Step = -1;
        }

        if (m_item.IsEnchanceExpItem())
        {
            if (EquipStrengthenLogic.Instance())
            {
                EquipStrengthenLogic.Instance().m_AutoChooseEnchanceStone = true;
            }
        }
    }
Пример #14
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);
        }