예제 #1
0
        //---------------------------------------------------------------------
        public void create(int default_level_vibid, float level_rate, bool single, bool fish_mustdie,
                           ILogicListener listener, float pumping_rate, List <int> list_turret_rate,
                           List <JsonPacket> json_packet_list, List <RouteJsonPacket> route_json_packet_list)
        {
            mProtocol       = new CLogicProtocol(this);
            mSceneBox       = new CSceneBox();
            mListener       = listener;
            mbSingle        = single;
            mfPumpingRate   = pumping_rate;
            mbFishMustDie   = fish_mustdie;
            mListTurretRate = list_turret_rate;

            // 初始化关卡
            if (default_level_vibid != -1)
            {
                mLevel = new CLogicLevel(this);
                mLevel.create(default_level_vibid, level_rate, json_packet_list, route_json_packet_list);
            }

            // 初始化特效管理器
            mEffectMgr = new CEffectMgr();
            mEffectMgr.regEffectFactory(new EffectSpreadFishFactory());
            mEffectMgr.regEffectFactory(new EffectTimeStopFactory());
            mEffectMgr.regEffectFactory(new LogicEffectLightingChainFactory());
            mEffectMgr.regEffectFactory(new LogicEffectFullScreenBombFactory());
            mEffectMgr.regEffectFactory(new LogicEffectAOEFactory());

            mColliderMgr = new TagColliderMgr();
        }
예제 #2
0
        //---------------------------------------------------------------------
        public void destroy()
        {
            if (mLevel != null)
            {
                mLevel.destroy();
                mLevel = null;
            }

            foreach (var i in mMapPlayerTurret)
            {
                i.Value.Dispose();
            }
            mMapPlayerTurret.Clear();

            if (mSceneBox != null)
            {
                mSceneBox = null;
            }

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

            if (mColliderMgr != null)
            {
                mColliderMgr.destroy();
                mColliderMgr = null;
            }
        }
예제 #3
0
        //-------------------------------------------------------------------------
        public void destroy()
        {
            if (mDestroy)
            {
                return;
            }
            mDestroy = true;
            TagColliderMgr collider_mgr = mScene.getColliderMgr();

            if (collider_mgr == null)
            {
                return;
            }
            collider_mgr.removeCollider(mFishCollider);
            mFishCollider = null;
        }