Exemple #1
0
        //-------------------------------------------------------------------------
        public void update(float elapsed_tm)
        {
            CRenderLevel level = mScene.getLevel();

            if (level == null)
            {
                return;
            }

            mfTotalSecond += elapsed_tm;

            if (mScene.getMyPlayerId() == mPlayer.et_player_rpcid && !mScene.isSingleMode())
            {
                mfIdleSecond += elapsed_tm;
                if (mfIdleSecond > 60.0f)
                {
                    mfObCountdown -= elapsed_tm;
                    if (mfObCountdown <= 0.0f)
                    {
                        mfIdleSecond  = 0.0f;
                        mfObCountdown = 60.0f;
                        mScene.getListener().onScenePlayerChange2Ob();
                    }
                    else
                    {
                        string str = "由于您一分钟没有发射炮弹 系统将在[ff0000]" + ((int)mfObCountdown).ToString() + "秒[-]后进入[00ffff]观战模式[-]";
                        //mScene.getListener().onSceneShowMessageBox(str, false, "", 1, (int)_eMessageBoxLayer.Ob, false, false);
                    }
                }
                else
                {
                    mfObCountdown = 60.0f;
                }

                if (mRenderBufferMgr.hasBuffer("BufLongpress") || mRenderBufferMgr.hasBuffer("BufRapid"))
                {
                    mfIdleSecond  = 0.0f;
                    mfObCountdown = 60.0f;
                }
            }

            mCSpriteTurretShow.update(elapsed_tm);
            mRenderBufferMgr.update(elapsed_tm);
        }