Ejemplo n.º 1
0
        public void Update()
        {
            if (!mIsInited)
            {
                return;
            }

            if (Input.GetKeyUp(KeyCode.Escape))
            {
                Debug.Log("KeyCode.Escape pressed");
#if UNITY_IPHONE
                IBridge bridge = DBOSManager.getDBOSManager().getBridge();
                if (bridge != null && bridge.isBridgeEnable())
                {
                    // 退出游戏的时候通知sdk
                    SDKControler.getSDKControler().sendRoleInfo2SDK((int)SDKControler.RoleEvent.EXIT_GAME);
                    bridge.checkBackBtnAction();
                }
#else
                var exit_game = true;
                if (xc.Const.Region == RegionType.KOREA)
                {
                    if (UIManager.Instance.TryCloseAllWindow())
                    {
                        exit_game = false;
                    }
                }
                if (exit_game)
                {
                    Debug.Log("KeyCode.Escape pressed exit_game = true");
                    IBridge bridge = DBOSManager.getDBOSManager().getBridge();
                    if (bridge != null && bridge.isBridgeEnable())
                    {
                        // 退出游戏的时候通知sdk
                        SDKControler.getSDKControler().sendRoleInfo2SDK((int)SDKControler.RoleEvent.EXIT_GAME);
                        bridge.checkBackBtnAction();
                    }
                }
#endif
            }

            m_GameMachine.Update();
            UIManager.Instance.Update();

            // 场景加载完成的检查
            SceneLoadingUpdate();

            TimerManager.GetInstance().Update();
            DecimalTimerManager.GetInstance().Update();
            EffectManager.GetInstance().Update();
            TargetPathManager.Instance.Update();
            TaskManager.Instance.Update();
            InstanceManager.Instance.Update();
            UINotice.Instance.Update();
            TeamManager.Instance.Update();
            MainmapManager.Instance.Update();
            TimelineManager.Instance.Update();
            ShadowManager.Instance.Update();
            GuideManager.Instance.Update();

    #if !UNITY_MOBILE_LOCAL
            VoiceManager.Instance.Update();
    #endif

            NetReconnect.Instance.Update();
            if (ChangeRoleManager.Instance.IsChangeRole)
            {
                ChangeRoleManager.Instance.Update();
            }

#if UNITY_EDITOR
            TestUnit.Instance.Update();
#endif
            Uranus.Runtime.UranusManager.Instance.Update();
            MarryFireworkManager.Instance.Update();

            NetworkManager.Instance.Update();
            if (((int)GameMode & (int)EGameMode.GM_Net) == (int)EGameMode.GM_Net)
            {
                NetClient.GetBaseClient().Update();
                if (NetClient.CrossToggle)
                {
                    NetClient.GetCrossClient().Update();
                }
            }

            // 协程更新
            // 最好在其他模块都更新好,再更新协程
            SafeCoroutine.CoroutineManager.Update(Time.deltaTime);
        }
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();
        }