예제 #1
0
        public IEnumerator Init(ResourceConfig config, ICoRoutineManager coRoutineManager, bool isServer = false)
        {
            _logger.InfoFormat("UnityAssetManager init:IsServer:{0} ,Quality:{1}", isServer,
                               SettingManager.SettingManager.GetInstance().GetQualityBeforeInit());
            coRoutineManager.StartCoRoutine(InitUpdate());
            coRoutineManager.StartCoRoutine(Init(config,
                                                 !isServer && SettingManager.SettingManager.GetInstance().GetQualityBeforeInit() ==
                                                 SettingManager.QualityLevel.Low));

            yield return(new WaitUntil(() => _isInitialized));
        }
예제 #2
0
        public IEnumerator Init(ResourceConfig config, ICoRoutineManager coRoutineManager, bool isServer = false, string useMD5 = null)
        {
#if !UNITY_EDITOR
            var isLQ =
                SettingManager.SettingManager.GetInstance().GetQualityBeforeInit() == SettingManager.QualityLevel.Low;
#else
            var isLQ = false;
#endif
            _logger.InfoFormat("UnityAssetManager init:IsServer:{0} ,Quality:{1}", isServer,
                               SettingManager.SettingManager.GetInstance().GetQualityBeforeInit());
            coRoutineManager.StartCoRoutine(InitUpdate());
            coRoutineManager.StartCoRoutine(Init(config,
                                                 !isServer && isLQ, useMD5));

            yield return(new WaitUntil(() => _isInitialized));
        }
예제 #3
0
        public void Dispose()
        {
#if UNITY_SOURCE_MODIFIED && !UNITY_EDITOR
            UnityProfiler.EnableProfiler(false);
#endif
            _state = RoomState.Disposing;
            DisposePlayerConnections();
            if (_bin2DManager != null)
            {
                _bin2DManager.Dispose();
            }

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

            _contexts.session.commonSession.Dispose();
            _contexts.session.serverSessionObjects.Dispose();

            GameModuleManagement.Dispose();
            try
            {
                ResetContexts(true);
                _sessionStateMachine.ShutDown();
                _contexts.Reset();
            }
            catch (Exception e)
            {
                _logger.ErrorFormat("Reset Contexts Error {0}", e);
            }

            _contexts = null;

            DestoryObjectUnderDefaultGoBattleServer();
            _coRoutineManager.StartCoRoutine(UnloadScene());

            _logger.InfoFormat("Server Room is Disposing...");
        }