Ejemplo n.º 1
0
    //-------------------------------------------------------------------------
    void _destory()
    {
        if (mEngine == null)
        {
            return;
        }

        if (mEngine != null)
        {
            mEngine.close();
            mEngine = null;
        }

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

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

        if (mAsyncLoadAssetMgr != null)
        {
            mAsyncLoadAssetMgr.destory();
            mAsyncLoadAssetMgr = null;
        }

        Screen.sleepTimeout = SleepTimeout.SystemSetting;

        EbLog.Note("MbMain._destory()");
    }
Ejemplo n.º 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();
        }
Ejemplo n.º 3
0
    //-------------------------------------------------------------------------
    void Start()
    {
        // 初始化系统参数
        {
            Application.runInBackground = true;
            Time.fixedDeltaTime         = 0.03f;
            Application.targetFrameRate = 60;
            Screen.sleepTimeout         = SleepTimeout.NeverSleep;
        }

        // 初始化日志
        {
            EbLog.NoteCallback    = Debug.Log;
            EbLog.WarningCallback = Debug.LogWarning;
            EbLog.ErrorCallback   = Debug.LogError;
        }

        EbLog.Note("MbMain.Start()");

        // 初始化PathMgr
        if (mPathMgr == null)
        {
            mPathMgr = new PathMgr();
        }

        if (mClientConfig == null)
        {
            mClientConfig = new ClientConfig();
        }

        if (mAsyncLoadAssetMgr == null)
        {
            mAsyncLoadAssetMgr = new AsyncLoadAssetMgr();
            mAsyncLoadAssetMgr.init();
        }

        if (mEngine == null)
        {
            EcEngineSettings settings;
            settings.ProjectName         = "Fishing";
            settings.RootEntityType      = "EtRoot";
            settings.EnableCoSuperSocket = true;
            mEngine = new EcEngine(ref settings, new EcEngineListener());
        }

        UiMgr = new UiMgr();
        UiMgr.create(EntityMgr.Instance);

        mSoundMgr = new CSoundMgr();

        // 创建EtClientApp
        EntityMgr.Instance.createEntity <EtApp>(null, EcEngine.Instance.EtNode);
    }
Ejemplo n.º 4
0
    private void OnTriggerExit2D(Collider2D collision)
    {
        CSoundMgr SoundMgr = GameObject.Find("SoundMgr").GetComponent <CSoundMgr>();

        SoundMgr.RestoreDefaltBGM();
    }
Ejemplo n.º 5
0
    private void OnTriggerEnter2D(Collider2D collision)
    {
        CSoundMgr SoundMgr = GameObject.Find("SoundMgr").GetComponent <CSoundMgr>();

        SoundMgr.PlaySound(PlayBGMName, ESoundType.BGM);
    }
Ejemplo n.º 6
0
 //-------------------------------------------------------------------------
 public CSoundLayerIgnore(CSoundMgr sound_mgr)
 {
     mSoundMgr = sound_mgr;
 }
Ejemplo n.º 7
0
 //-------------------------------------------------------------------------
 public CSoundLayerBackground(CSoundMgr sound_mgr)
 {
     mSoundMgr = sound_mgr;
 }
Ejemplo n.º 8
0
 //-------------------------------------------------------------------------
 public CSoundLayerNormal(CSoundMgr sound_mgr)
 {
     mSoundMgr = sound_mgr;
 }
Ejemplo n.º 9
0
 //-------------------------------------------------------------------------
 public CSoundLayerReplace(CSoundMgr sound_mgr)
 {
     mSoundMgr = sound_mgr;
 }
Ejemplo n.º 10
0
        //-------------------------------------------------------------------------
        public void create(uint my_et_player_rpcid, bool single, bool is_bot, IRenderListener listener,
                           string configure_filepath, List <JsonPacket> json_packet_list, List <RouteJsonPacket> route_json_packet_list)
        {
            mMyPlayerId    = my_et_player_rpcid;
            mbSingle       = single;
            mListener      = listener;
            mbInit         = false;
            mIsBot         = is_bot;
            mConfigurePath = configure_filepath;

            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;

            CCoordinate.setCoordinate(new EbVector3(Screen.width, Screen.height, 0),
                                      EbVector3.Zero, new EbVector3(Screen.width, Screen.height, 0));
            mSceneBox     = new CSceneBox();
            mProtocol     = new CRenderProtocol(this);
            mTurretHelper = new CTurretHelper();
            mLayerAlloter = new RenderLayerAlloter();

            mEffectMgr = new CEffectMgr();
            if (!isBot())
            {
                mEffectMgr.regEffectFactory(new EffectShockScreenFactory());
                mEffectMgr.regEffectFactory(new EffectFrameAnimationFactory());
                mEffectMgr.regEffectFactory(new EffectPlayAudioFactory());
                mEffectMgr.regEffectFactory(new EffectLightingFactory());
                mEffectMgr.regEffectFactory(new EffectLockScreenFactory());
                mEffectMgr.regEffectFactory(new EffectFullScreenFactory());
                mEffectMgr.regEffectFactory(new EffectAOEFactory());
            }
            else
            {
                //mEffectMgr.regEffectFactory(new EffectShockScreenFactory());
                mEffectMgr.regEffectFactory(new EffectFrameAnimationFactory());
                //mEffectMgr.regEffectFactory(new EffectPlayAudioFactory());
                mEffectMgr.regEffectFactory(new EffectLightingFactory());
                mEffectMgr.regEffectFactory(new EffectLockScreenFactory());
                mEffectMgr.regEffectFactory(new EffectFullScreenFactory());
                mEffectMgr.regEffectFactory(new EffectAOEFactory());
            }

            mSpriteFishFactory   = new SpriteFishFactory(this);
            mJsonPacketList      = json_packet_list;
            mRouteJsonPacketList = route_json_packet_list;

            mRenderConfigure = new RenderConfigure(mConfigurePath);

            mSoundMgr         = MbMain.Instance.getSoundMgr();
            mRenderObjectPool = new CRenderObjectPool(this);
            mParticlemanager  = new ParticleManager(this);
            mLoadableManager  = new LoadableManager();
            mLoadableManager.create(mRenderObjectPool);
        }
Ejemplo n.º 11
0
    //-------------------------------------------------------------------------
    void Start()
    {
        // 初始化系统参数
        {
            Application.runInBackground = true;
            Time.fixedDeltaTime = 0.03f;
            Application.targetFrameRate = 60;
            Screen.sleepTimeout = SleepTimeout.NeverSleep;
        }

        // 初始化日志
        {
            EbLog.NoteCallback = Debug.Log;
            EbLog.WarningCallback = Debug.LogWarning;
            EbLog.ErrorCallback = Debug.LogError;
        }

        EbLog.Note("MbMain.Start()");

        // 初始化PathMgr
        if (mPathMgr == null)
        {
            mPathMgr = new PathMgr();
        }

        if (mClientConfig == null)
        {
            mClientConfig = new ClientConfig();
        }

        if (mAsyncLoadAssetMgr == null)
        {
            mAsyncLoadAssetMgr = new AsyncLoadAssetMgr();
            mAsyncLoadAssetMgr.init();
        }

        if (mEngine == null)
        {
            EcEngineSettings settings;
            settings.ProjectName = "Fishing";
            settings.RootEntityType = "EtRoot";
            mEngine = new EcEngine(ref settings, new EcEngineListener());
        }

        UiMgr = new UiMgr();
        UiMgr.create(EntityMgr.Instance);

        mSoundMgr = new CSoundMgr();

        // 创建EtClientApp
        EntityMgr.Instance.createEntity<EtApp>(null, EcEngine.Instance.EtNode);
    }
Ejemplo n.º 12
0
 //-------------------------------------------------------------------------
 public CSoundLayerBackground(CSoundMgr sound_mgr)
 {
     mSoundMgr = sound_mgr;
 }
Ejemplo n.º 13
0
 //-------------------------------------------------------------------------
 public CSoundLayerReplace(CSoundMgr sound_mgr)
 {
     mSoundMgr = sound_mgr;
 }
Ejemplo n.º 14
0
 //-------------------------------------------------------------------------
 public CSoundLayerNormal(CSoundMgr sound_mgr)
 {
     mSoundMgr = sound_mgr;
 }
Ejemplo n.º 15
0
 //-------------------------------------------------------------------------
 public CSoundLayerIgnore(CSoundMgr sound_mgr)
 {
     mSoundMgr = sound_mgr;
 }
Ejemplo n.º 16
0
        //-------------------------------------------------------------------------
        public void create(uint my_et_player_rpcid, bool single, bool is_bot, IRenderListener listener,
            string configure_filepath, List<JsonPacket> json_packet_list, List<RouteJsonPacket> route_json_packet_list)
        {
            mMyPlayerId = my_et_player_rpcid;
            mbSingle = single;
            mListener = listener;
            mbInit = false;
            mIsBot = is_bot;
            mConfigurePath = configure_filepath;

            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;

            CCoordinate.setCoordinate(new EbVector3(Screen.width, Screen.height, 0),
                EbVector3.Zero, new EbVector3(Screen.width, Screen.height, 0));
            mSceneBox = new CSceneBox();
            mProtocol = new CRenderProtocol(this);
            mTurretHelper = new CTurretHelper();
            mLayerAlloter = new RenderLayerAlloter();

            mEffectMgr = new CEffectMgr();
            if (!isBot())
            {
                mEffectMgr.regEffectFactory(new EffectShockScreenFactory());
                mEffectMgr.regEffectFactory(new EffectFrameAnimationFactory());
                mEffectMgr.regEffectFactory(new EffectPlayAudioFactory());
                mEffectMgr.regEffectFactory(new EffectLightingFactory());
                mEffectMgr.regEffectFactory(new EffectLockScreenFactory());
                mEffectMgr.regEffectFactory(new EffectFullScreenFactory());
                mEffectMgr.regEffectFactory(new EffectAOEFactory());
            }
            else
            {
                //mEffectMgr.regEffectFactory(new EffectShockScreenFactory());
                mEffectMgr.regEffectFactory(new EffectFrameAnimationFactory());
                //mEffectMgr.regEffectFactory(new EffectPlayAudioFactory());
                mEffectMgr.regEffectFactory(new EffectLightingFactory());
                mEffectMgr.regEffectFactory(new EffectLockScreenFactory());
                mEffectMgr.regEffectFactory(new EffectFullScreenFactory());
                mEffectMgr.regEffectFactory(new EffectAOEFactory());
            }

            mSpriteFishFactory = new SpriteFishFactory(this);
            mJsonPacketList = json_packet_list;
            mRouteJsonPacketList = route_json_packet_list;

            mRenderConfigure = new RenderConfigure(mConfigurePath);

            mSoundMgr = MbMain.Instance.getSoundMgr();
            mRenderObjectPool = new CRenderObjectPool(this);
            mParticlemanager = new ParticleManager(this);
            mLoadableManager = new LoadableManager();
            mLoadableManager.create(mRenderObjectPool);
        }
Ejemplo n.º 17
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();
        }
Ejemplo n.º 18
0
    //-------------------------------------------------------------------------
    void _destory()
    {
        if (mEngine == null) return;

        if (mEngine != null)
        {
            mEngine.close();
            mEngine = null;
        }

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

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

        if (mAsyncLoadAssetMgr != null)
        {
            mAsyncLoadAssetMgr.destory();
            mAsyncLoadAssetMgr = null;
        }

        Screen.sleepTimeout = SleepTimeout.SystemSetting;

        EbLog.Note("MbMain._destory()");
    }