Beispiel #1
0
    private void UpdateMainArenaDataUI()
    {
        if (mModule == null)
        {
            return;
        }

        mTimer = mModule.GetTimer(mPlayerDataModule.GetArenaLastTime());

        UpdateTimer();

        if (mPlayerDataModule.GetArenaCurRank() == uint.MaxValue)
        {
            mRankingText.text = StringHelper.GetString("arena_outofrank");
        }
        else
        {
            mRankingText.text = (mPlayerDataModule.GetArenaCurRank() + 1).ToString();
        }

        mScoreText.text = mPlayerDataModule.GetArenaScore().ToString();

        mLeftTimesText.text = mPlayerDataModule.GetArenaLeftTimes().ToString() + StringHelper.GetString("times");

        mRankLevelText.text = mModule.GetRankLevelStringByRanking(mPlayerDataModule.GetArenaCurRank());
    }
Beispiel #2
0
    // 请求挑战
    public void RequestBegin(int index)
    {
        if (index < 0 || index >= mSimpleData.Count)
        {
            return;
        }

        if (GetTimer(mDataModule.GetArenaLastTime()) > float.Epsilon)
        {
            PopTipManager.Instance.AddNewTip(StringHelper.GetErrorString(ERROR_CODE.ERR_ARENA_BEGIN_FAILED_CD, FontColor.Red));
            //PromptUIManager.Instance.AddNewPrompt(StringHelper.GetErrorString(ERROR_CODE.ERR_ARENA_BEGIN_FAILED_CD));
            EventSystem.Instance.PushEvent(new ArenaEvent(ArenaEvent.UI_ARENA_BEGIN_FAILED_CD));
            return;
        }

        if (mDataModule.GetArenaLeftTimes() == 0)
        {
            PopTipManager.Instance.AddNewTip(StringHelper.GetErrorString(ERROR_CODE.ERR_ARENA_BEGIN_FAILED_NOTIMES, FontColor.Red));
            //PromptUIManager.Instance.AddNewPrompt(StringHelper.GetErrorString(ERROR_CODE.ERR_ARENA_BEGIN_FAILED_NOTIMES));
            EventSystem.Instance.PushEvent(new ArenaEvent(ArenaEvent.UI_ARENA_BEGIN_FAILED_NOTIMES));
            return;
        }

        mGhostGUID = null;
        AwardScore = 0;
        AwardPoint = 0;
        Win        = false;

        ArenaBeginActionParam param = new ArenaBeginActionParam();

        param.guid = mSimpleData[index].guid;
        Net.Instance.DoAction((int)Message.MESSAGE_ID.ID_MSG_ARENA_BEGIN, param);
    }