Exemplo n.º 1
0
    void SendPlayerReliveMsg()
    {
        CG_ASK_RELIVE packet = (CG_ASK_RELIVE)PacketDistributed.CreatePacket(MessageID.PACKET_CG_ASK_RELIVE);

        packet.SetType((int)Games.GlobeDefine.GameDefine_Globe.RELIVE_TYPE.RELIVE_CITY);
        packet.SendPacket();
    }
Exemplo n.º 2
0
    public void RliveOriginalButton()
    {
        CG_ASK_RELIVE packet = (CG_ASK_RELIVE)PacketDistributed.CreatePacket(MessageID.PACKET_CG_ASK_RELIVE);

        packet.SetType((int)Games.GlobeDefine.GameDefine_Globe.RELIVE_TYPE.RELIVE_ORIGINAL);
        packet.SendPacket();
    }
Exemplo n.º 3
0
    public void RliveCityOK()
    {
        //如果角色Dead&&在幅本中.打开失败界面
        Obj_MainPlayer _mainPlayer = Singleton <ObjManager> .GetInstance().MainPlayer;

        if (_mainPlayer == null)
        {
            return;
        }
        if (_mainPlayer.IsDie() && GameManager.gameManager.ActiveScene.IsStoryCopyScene())
        {
            UIManager.CloseUI(UIInfo.Relive);
            UIManager.ShowUI(UIInfo.StoryCopySceneResultRoot, OnShowStoryCopySceneResultWindow);
            return;
        }
        if (_mainPlayer.IsDie() && GameManager.gameManager.ActiveScene.IsCopyScene())
        {
            UIManager.CloseUI(UIInfo.Relive);
            UIManager.ShowUI(UIInfo.FailRoot, OnShowFailRootWindow);
        }
        else
        {
            CG_ASK_RELIVE packet = (CG_ASK_RELIVE)PacketDistributed.CreatePacket(MessageID.PACKET_CG_ASK_RELIVE);
            packet.SetType((int)Games.GlobeDefine.GameDefine_Globe.RELIVE_TYPE.RELIVE_CITY);
            packet.SendPacket();
        }
    }
Exemplo n.º 4
0
    public void ReliveEntryButton()
    {
        if (m_nTimeData <= 0)
        {
            //可以复活
            CG_ASK_RELIVE packet = (CG_ASK_RELIVE)PacketDistributed.CreatePacket(MessageID.PACKET_CG_ASK_RELIVE);
            packet.SetType((int)Games.GlobeDefine.GameDefine_Globe.RELIVE_TYPE.RELIVE_ENTRY);
            packet.SendPacket();
        }
        else
        {
            Obj_MainPlayer _mainPlayer = Singleton <ObjManager> .GetInstance().MainPlayer;

            if (_mainPlayer != null)
            {
                //提示CD未到
                Singleton <ObjManager> .GetInstance().MainPlayer.SendNoticMsg(false, "#{1027}");
            }
        }
    }
Exemplo n.º 5
0
    // Update is called once per frame
    void DoSomeThing()
    {
        if (null == Singleton <ObjManager> .GetInstance().MainPlayer)
        {
            return;
        }

        //string str = StrDictionary.GetClientDictionaryString("#{1035}");
        string str = "";

        m_nTimeData = Singleton <ObjManager> .GetInstance().MainPlayer.ReliveEntryTime;

        if (m_nTimeData < 0)
        {
            m_nTimeData = 0;
        }
        if (m_nTimeData / 60 > 0)
        {
            //str += (m_nTimeData / 60).ToString() + "分";
            str = StrDictionary.GetClientDictionaryString("#{2873}", (m_nTimeData / 60), (m_nTimeData % 60));
        }
        else
        {
            str = StrDictionary.GetClientDictionaryString("#{2872}", (m_nTimeData % 60));
        }

        //str += (m_nTimeData%60).ToString() + "秒";
        m_ReliveEntryTitle.text = str;

        if (Time.realtimeSinceStartup - ReliveSend > 5)
        {
            ReliveSend = Time.realtimeSinceStartup;
            //去掉挂机判断.
            if (Singleton <ObjManager> .Instance.MainPlayer.GetAutoCombatState()) //挂机 中自动复活
            {
                Tab_SceneClass pSceneClass = TableManager.GetSceneClassByID(GameManager.gameManager.RunningScene, 0);
                if (pSceneClass != null)
                {
                    if (pSceneClass.GetReliveTypebyIndex(0) == 1 && Singleton <ObjManager> .Instance.MainPlayer.BaseAttr.Level <= 30)  //原地复活
                    {
                        RliveOriginalButton();
                    }
                    else if (pSceneClass.GetReliveTypebyIndex(1) == 1)     //入口复活
                    {
                        if (m_nTimeData <= 0)
                        {
                            //可以复活
                            CG_ASK_RELIVE packet = (CG_ASK_RELIVE)PacketDistributed.CreatePacket(MessageID.PACKET_CG_ASK_RELIVE);
                            packet.SetType((int)Games.GlobeDefine.GameDefine_Globe.RELIVE_TYPE.RELIVE_ENTRY);
                            packet.SendPacket();
                        }
                    }
                    else if (pSceneClass.GetReliveTypebyIndex(2) == 1)  //回主城
                    {
                        RliveCityButton();
                    }
                }
            }
            else
            {
                Tab_SceneClass pSceneClass = TableManager.GetSceneClassByID(GameManager.gameManager.RunningScene, 0);
                if (pSceneClass != null)
                {
                    if (pSceneClass.GetReliveTypebyIndex(1) == 1)     //入口复活
                    {
                        if (m_nTimeData <= 0)
                        {
                            if (Singleton <ObjManager> .Instance.MainPlayer.BaseAttr.Level <= 30)
                            {
                                //RliveOriginalButton();
                            }
                            else
                            {
                                //可以复活
                                CG_ASK_RELIVE packet = (CG_ASK_RELIVE)PacketDistributed.CreatePacket(MessageID.PACKET_CG_ASK_RELIVE);
                                packet.SetType((int)Games.GlobeDefine.GameDefine_Globe.RELIVE_TYPE.RELIVE_ENTRY);
                                packet.SendPacket();
                            }
                        }
                    }
                }
            }
        }
    }