Ejemplo n.º 1
0
        /// <summary>
        /// 销毁场景数据
        /// </summary>
        void DestroyScene(bool clearUI = true)
        {
            DialogManager.Instance.Reset();

            // 保存客户端需要保存的玩家信息
            LocalPlayerManager.Instance.OnDestroyScene();

            // 销毁所有场景不需要的数据
            if (ActorManager.Instance != null)
            {
                ActorManager.Instance.OnDestroyScene();
            }

            InterObjectManager.Instance.DestroyAllAndBoss();

            Game.Instance.SetLocalPlayer(null);

            CullManager.GetInstance().Reset();

            if (ObjCachePoolMgr.Instance != null)
            {
                ObjCachePoolMgr.Instance.OnDestroyScene(clearUI);
            }

            ObjInstHelp.GetInstance().ClearInstedObject();
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 游戏数据重置,在断线重连时ignore_reconnect设置为true
        /// </summary>
        /// <param name="ignore_reconnect"></param>
        public void Reset(bool ignore_reconnect = false)
        {
            mAllSystemInited = false;

            // 初始化单件对象,在计时器、表格和网络数据初始化之后
            if (ignore_reconnect == false)
            {
                TimerManager.GetInstance().Reset();
            }
            DecimalTimerManager.GetInstance().Reset();
            UIManager.GetInstance().Reset();
            NpcManager.GetInstance().Reset();
            ItemManager.GetInstance().Reset(ignore_reconnect);
            DialogManager.GetInstance().Reset();
            InstanceManager.GetInstance().Reset(ignore_reconnect);
            InstanceDropManager.GetInstance().Reset();
            LocalPlayerManager.Instance.Reset(ignore_reconnect);
            RedPointDataMgr.Instance.Reset();
            LockIconDataMgr.Instance.Reset();
            NewMarkerDataMgr.Instance.Reset();
            if (ignore_reconnect == false)
            {
                RockCommandSystem.Instance.Reset();
            }
            CooldownManager.Instance.Reset();
            ShadowManager.Instance.Reset();
            GuideManager.GetInstance().Reset();
            SysConfigManager.GetInstance().Reset();
            SysPreviewManager.GetInstance().Reset();
            CullManager.GetInstance().Reset();
            MailManager2.Instance.Reset();
            LockTargetManager.Instance.Reset();
            InterObjectManager.Instance.Reset();
            FriendsManager.Instance.Reset(ignore_reconnect);
            TeamManager.Instance.Reset(ignore_reconnect);
            SkillHoleManager.Instance.Reset();
            SkillManager.Instance.Reset();
            TimelineManager.Instance.Reset();
            TaskManager.Instance.Reset();
            HookSettingManager.Instance.Reset();
            ShieldManager.Instance.Reset();
            GuildLeagueManager.Instance.Reset();
            MarryManager.Instance.Reset();
            SpanServerManager.Instance.Reset();
            if (ignore_reconnect == false)
            {
                UINotice.GetInstance().Reset();
                NetReconnect.Instance.Reset();
            }

            DBGuide db_guide = DBManager.GetInstance().GetDB <DBGuide>();

            db_guide.Reset();
            DBGuideStep db_guide_step = DBManager.GetInstance().GetDB <DBGuideStep>();

            db_guide_step.Reset();

            LuaScriptMgr.Instance.Reset(ignore_reconnect);
            CustomDataMgr.Instance.Reset();
            ChargeManager.Instance.Reset();
            AudioManager.Instance.Reset();
        }