Ejemplo n.º 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();
        }
Ejemplo n.º 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;
            }
        }