Example #1
0
    void OnReturn(GameObject obj)
    {
        UILabel rank = FindChildComponent <UILabel>(BattleSummary.Singleton.m_curRank);

        if (rank != null)
        {
            rank.gameObject.SetActive(false);
        }

        m_tick = false;

        //  进入floor前 如果背包 获得卡牌 大于背包容量 则 跳转
        if (CardBag.Singleton.IsPopSizeMax())
        {
            PopWnd.Singleton.Show();
        }

        m_quitBox.SetActive(false);
        BattleSummary.Singleton.m_fastPrizeCard = false;

        // 退出结算界面后才转到 主界面
        StateMainUI mainState = new StateMainUI();

        MainGame.Singleton.TranslateTo(mainState);

        HideWindow();
    }
Example #2
0
    // 战斗结算 服务器的回调
    public void BattleSummaryDungeonEnd(bool bVictory)
    {
        // 隐藏LOADING
        Loading.Singleton.Hide();

        // 关卡胜利
        if (bVictory)
        {
            // 计算卡牌技能升级情况
            TeamCardSkillLevelUpSummary();

            // 如果是手动退出
            if (m_manualQuit)
            {
                StateMainUI mainState = new StateMainUI();
                MainGame.Singleton.TranslateTo(mainState);
            }
            else
            {
                NotifyChanged((int)ENPropertyChanged.enShow, null);
            }
        }
        // 关卡失败
        else
        {
            ShowFail();
        }
    }
Example #3
0
    void OnClose(GameObject obj)
    {
        // 退出结算界面后才转到 主界面
        StateMainUI mainState = new StateMainUI();

        MainGame.Singleton.TranslateTo(mainState);

        HideWindow();
    }
 public void OnMessageRespond(MessageRespond res)
 {
     NotifyChanged(0, res);
     switch ((ENMessageRespond)res.RespondCode)
     {
     case ENMessageRespond.enDungeonIDNotFound:
     {
         if (!(MainGame.Singleton.CurrentState is StateMainUI))
         {
             StateMainUI mainState = new StateMainUI();
             MainGame.Singleton.TranslateTo(mainState);
         }
     }
     break;
     }
 }
Example #5
0
    private System.Collections.IEnumerator CoroutineOnFinished(bool manual, bool victory)
    {
        m_manualQuit = manual;

        // 如果不是手动退出
        if (false == m_manualQuit)
        {
            float time = 2f;

            WorldParamInfo worldParamInfo = GameTable.WorldParamTableAsset.Lookup((int)ENWorldParamIndex.enBattleFinishTime);
            if (null != worldParamInfo)
            {
                time = worldParamInfo.FloatTypeValue;
            }
            yield return(new WaitForSeconds(time));
        }
        Debug.Log(" 退出战斗 CoroutineOnFinished:");

        // 关卡胜利
        if (victory)
        {
            m_passStageTime = (int)(Time.time - BattleArena.Singleton.StageStartTime);
            m_maxComboCount = BattleArena.Singleton.MaxComboNumber;
            m_reliveCount   = BattleArena.Singleton.ReliveCount;
            m_killBossCount = BattleArena.Singleton.KillBossCount;
            List <int> DropList = BattleArena.Singleton.DropCardsIdList;
            // 如果是单机
            if (GameSettings.Singleton.m_isSingle)
            {
                // 如果手动退出
                if (m_manualQuit)
                {
                    StateMainUI mainState = new StateMainUI();
                    MainGame.Singleton.TranslateTo(mainState);
                }
                else
                {
                    OnShowBattleSummary();
                }
            }
            // 联网
            else
            {
                m_curRank = GetRank();
                // 显示 战斗结算界面
                m_desExp = (int)(GetBaseExp() * GetExpParam());

                m_desMoney = (int)(GetBaseMoney() * GetMoneyParam());

                Debug.Log("OnFinished:m_desExp " + m_desExp + ",m_desMoney:" + m_desMoney);

                // 显示LOADING
                Loading.Singleton.SetLoadingTips(1);

                // 发送服务器 战斗结束了
                //int curRankID = 0;
                //FloorRankInfo curRankInfo = GameTable.floorRankTableAsset.LookUp(m_curRank);
                //if (null != curRankInfo)
                //{
                //    curRankID = curRankInfo.m_rankID;
                //}

                int totalScore = GetKilledBossScore() + GetElapsedTimeScore() + GetMaxComboScore() + GetReliveScore();
                //todo
                IMiniServer.Singleton.SendDungeonSettlement(StageMenu.Singleton.m_curFloorId, m_passStageTime, m_maxComboCount, m_killBossCount, m_reliveCount, totalScore, m_desExp, m_desMoney, 1, DropList);
                //IMiniServer.Singleton.SendDungeonSettlement(curRankID, StageMenu.Singleton.m_curFloorId, m_desExp, m_desMoney,1);

                Debug.Log(" 退出战斗 战斗结算:" + StageMenu.Singleton.m_curFloorId + "," + m_passStageTime + "," + m_maxComboCount + "," + m_killBossCount + "," + m_reliveCount + "," + totalScore + "," + m_desExp + "," + m_desMoney + "," + DropList);
            }
        }

        // 关卡失败
        else
        {
            // 如果是单机
            if (GameSettings.Singleton.m_isSingle)
            {
                // 如果手动退出
                if (m_manualQuit)
                {
                    StateMainUI mainState = new StateMainUI();
                    MainGame.Singleton.TranslateTo(mainState);
                }
                else
                {
                    StateMainUI mainState = new StateMainUI();
                    MainGame.Singleton.TranslateTo(mainState);
                }
            }
            // 联网
            else
            {
                IMiniServer.Singleton.SendExitDungeon(StageMenu.Singleton.m_curFloorId);
            }
            Debug.Log(" 关卡失败 退出战斗 战斗结算:");
        }
    }