Exemplo n.º 1
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;
            }
        }
Exemplo n.º 2
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();
        }
Exemplo n.º 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;
        }
Exemplo n.º 4
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();
        }
Exemplo n.º 5
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;
            }
        }