예제 #1
0
        //-------------------------------------------------------------------------
        public static CSpriteFishDieScore getScore(CRenderScene render_scene, EbVector3 pos, int score, float delay_time)
        {
            CSpriteFishDieScore sprite_score = new CSpriteFishDieScore(render_scene, pos, score, delay_time);

            mSprites.Add(sprite_score);
            return(sprite_score);
        }
예제 #2
0
        //-------------------------------------------------------------------------
        public void destroy()
        {
            destroyLevel();

            destroyAllTurret();

            mParticleTurnplateCallerQueue.Clear();

            if (mEffectMgr != null)
            {
                mEffectMgr.destroy();
                mEffectMgr = null;
            }

            CSpriteFishDieScore.DestroyAll();

            mSceneBox = null;
            mListener = null;

            if (mProtocol != null)
            {
                mProtocol.Dispose();
                mProtocol = null;
            }

            if (mSoundMgr != null)
            {
                mSoundMgr.destroyAllSceneSound();
                mSoundMgr = null;
            }

            if (mRenderObjectPool != null)
            {
                mRenderObjectPool.destroy();
                mRenderObjectPool = null;
            }

            if (mParticlemanager != null)
            {
                mParticlemanager.destroy();
                mParticlemanager = null;
            }

            InputController.Instance.onFingerTouch       -= _onFingerTouch;
            InputController.Instance.onFingerLongPress   -= _onFingerLongPress;
            InputController.Instance.onFingerUp          -= _onFingerUp;
            InputController.Instance.onFingerDragMove    -= _onFingerDragMove;
            InputController.Instance.onFingerTouchTurret -= _onFingerTouchTurret;
            InputController.Instance.onFingerTouchBuffer -= _onFingerTouchBuffer;
            InputController.Instance.onFingerTouchFish   -= _onFingerTouchFish;
            InputController.Instance.ActiveInput          = true;

            _uninstallMemory();
        }
예제 #3
0
 //-------------------------------------------------------------------------
 public static CSpriteFishDieScore getScore(CRenderScene render_scene, EbVector3 pos, int score, float delay_time)
 {
     CSpriteFishDieScore sprite_score = new CSpriteFishDieScore(render_scene, pos, score, delay_time);
     mSprites.Add(sprite_score);
     return sprite_score;
 }
예제 #4
0
 //-------------------------------------------------------------------------
 static void remove(CSpriteFishDieScore number)
 {
     mReleaseSprites.Add(number);
 }
예제 #5
0
 //-------------------------------------------------------------------------
 static void remove(CSpriteFishDieScore number)
 {
     mReleaseSprites.Add(number);
 }
예제 #6
0
        //-------------------------------------------------------------------------
        public void update(float elapsed_tm)
        {
            if (mIsLoadingScene)
            {
                if (mLoadableManager.Loaded)
                {
                    getListener().onSceneCreated();
                    mIsLoadingScene = false;
                    mLoadableManager.destroy();
                    //UiMgr.Instance.destroyCurrentUi<UiMbLoading>();
                    return;
                }

                mLoadableManager.update(elapsed_tm);
                _loadingInfo(mLoadableManager.Progress, mLoadableManager.LoadingInfo);
                return;
            }

            mRenderObjectPool.update();// 要先于Level Update

            mProtocol.update(elapsed_tm);

            foreach (var it in mParticleTurnplateCallerQueue)
            {
                it.update(elapsed_tm);
            }

            mParticlemanager.update(elapsed_tm);

            // 根据屏幕分辨率更新坐标
            Resolution cur_resolution = Screen.currentResolution;

            CCoordinate.setCoordinate(new EbVector3(Screen.width, Screen.height, 0),
                                      EbVector3.Zero, new EbVector3(Screen.width, Screen.height, 0));

            // 更新炮台
            foreach (var i in mMapPlayerTurret)
            {
                i.Value.update(elapsed_tm);
            }

            // 更新关卡
            if (mLevel != null)
            {
                mLevel.update(elapsed_tm);
            }

            // 更新效果管理器
            mEffectMgr.update(elapsed_tm);

            // 更新所有鱼死亡分数显示
            CSpriteFishDieScore.updateall(elapsed_tm);

            // 本人正在观战
            if (mMyTurret == null && mLevel != null)
            {
                string str = "正在观战中...";
                //getListener().onSceneShowMessageBox(str, false, "", 1, (int)_eMessageBoxLayer.Ob, true, true);
            }

            displaySceneStateInfo(elapsed_tm);
        }
예제 #7
0
        //-------------------------------------------------------------------------
        void _die(uint et_player_rpcid, int total_score)
        {
            if (mIsDie)
            {
                return;
            }

            mPlayerId   = et_player_rpcid;
            mTotalScore = total_score;

            mSpriteFreeFromTimeFactor = true;

            // 播放鱼死亡时候的粒子特效
            mFishParticleMgr.fishDie();

            // 显示掉落金币数字
            if (total_score > 0)
            {
                CSpriteFishDieScore score = CSpriteFishDieScore.getScore(mScene, mMassEntity.Position, total_score, 2);//待整理
            }

            // 播放鱼死亡时触发的特效
            foreach (var it in mVibFish.Effects)
            {
                int vib_compose_id = it.Id;

                if (vib_compose_id <= 0)
                {
                    continue;
                }

                Dictionary <string, object> param = new Dictionary <string, object>();
                param.Add("SourcePosition", mMassEntity.Position);
                param.Add("SourceAngle", 0f);
                param.Add("PlayerId", et_player_rpcid);
                CRenderTurret turret = mScene.getTurret(et_player_rpcid);
                if (turret != null)
                {
                    param.Add("DestPosition", turret.getTurretPos());
                }
                else
                {
                    param.Add("DestPosition", mMassEntity.Position);
                }
                param.Add("IsFishDie", true);
                mScene.addEffect(vib_compose_id, param, EffectTypeEnum.Client);
            }

            // 处理SpriteFish
            mFishStopMove = true;

            if (mISpriteFish != null)
            {
                mISpriteFish.playDieAnimation();
            }

            if (mVibFish.Red == TbDataFish.IsRed.YES)
            {
                mScene.getLevel().addRedFishPosition(mFishObjId, Position);
            }

            signDie();
        }