Esempio n. 1
0
        public override IEnumerator Start()
        {
            yield return(EB.Assets.LoadAsync("_GameAssets/Res/Prefabs/UIPrefabs/MainHudUI", typeof(GameObject), o =>
            {
                if (o)
                {
                    var mainhud = GameObject.Instantiate(o) as GameObject;
                    mainhud.name = "MainHudUI";
                    GameObject camera = GameObject.Find("DownloadHudUI/OrthoCam");
                    if (camera != null)
                    {
                        camera.transform.SetParent(mainhud.transform);
                    }
                }
            }));

            //切到GameStateStart状态 transform to GameStateStart
            Mgr.SetGameState <GameStateStart>();

            //加载UIHelper全局的ui预设 Load UIHelper
            UIStack.Instance.LoadUIHelper();
            //加载StoryPrefab
            LoadStoryPrefab();
            yield break;
        }
Esempio n. 2
0
        private IEnumerator WaitForReady()
        {
            DateTime t = DateTime.Now;

            EB.Debug.Log("WaitForReady=====>_{0}", t.ToString("yyyy-MM-dd hh:mm:ss fff"));
            while (!HudLoadManager.IsReady)
            {
                if (!HudLoadManager.IsLoadingConfig)
                {
                    HudLoadManager.LoadConfigAsync();
                }
                yield return(null);
            }
            LoadingLogic.AddCustomProgress(5);
            while (!SceneLoadManager.IsReady)
            {
                if (!SceneLoadManager.IsLoadingConfig)
                {
                    SceneLoadManager.LoadConfigAsync();
                }
                yield return(null);
            }
            LoadingLogic.AddCustomProgress(5);

            Mgr.SetGameState <GameStateLoadGame>();

            t = DateTime.Now;
            EB.Debug.Log("<=====WaitForReady_{0}", t.ToString("yyyy-MM-dd hh:mm:ss fff"));
        }
Esempio n. 3
0
        public override IEnumerator Start()
        {
            GameStateDownload.LogWithTime("LTGameStateStart.START=====>");
            InitializeSparx(GameEngine.Instance.ApiServerAddress);
            InitializeFusion();
            InitializeReplication();
            yield return(new WaitUntil(() => CharacterCatalog.Instance.isModelsLoaded));//等CharacterModel相关资源加载完成

            InitializeOfflineData();
            while (EB.Assets.IsLoadingScene)
            {
                yield return(null);
            }

            Mgr.SetGameState <GameStateLogin>();
            GameStateDownload.LogWithTime("<=====LTGameStateStart.START");
        }
Esempio n. 4
0
    public override void Update()
    {
        base.Update();
        if (m_has_start_butten_been_pressed)
        {
            GameEngine.Instance.IsResetUserData = false;
            DebugSystem.UnregisterSystem(this);

            GameEngine.Instance.ApiServerAddress  = GetApiServerAddress();
            GameEngine.Instance.OtaServerAddress  = GetOtaServerAddress();
            GameEngine.Instance.IsFTE             = m_fte;
            GameEngine.Instance.ApiCheckCompleted = !m_api_check;
            UserData.Locale = GetLocale();

#if UNITY_EDITOR
            Application.runInBackground = m_run_after_lost_focus;
#endif

            Mgr.SetGameState <GameStateDownload>();
        }

        if (m_has_reset_user_data_butten_been_pressed)
        {
            GameEngine.Instance.IsResetUserData = true;
            DebugSystem.UnregisterSystem(this);

            GameEngine.Instance.ApiServerAddress  = GetApiServerAddress();
            GameEngine.Instance.OtaServerAddress  = GetOtaServerAddress();
            GameEngine.Instance.IsFTE             = m_fte;
            GameEngine.Instance.ApiCheckCompleted = !m_api_check;
            UserData.Locale = GetLocale();

#if UNITY_EDITOR
            Application.runInBackground = m_run_after_lost_focus;
#endif

            Mgr.SetGameState <GameStateDownload>();
        }
    }