// Use this for initialization internal void Start() { Application.targetFrameRate = 60; QualitySettings.vSyncCount = 1; QualitySettings.SetQualityLevel(1); try { if (!GameControler.IsInited) { Application.runInBackground = true; string dataPath = Application.dataPath; string persistentDataPath = Application.persistentDataPath; string streamingAssetsPath = Application.streamingAssetsPath; string tempPath = Application.temporaryCachePath; LogicSystem.GfxLog("dataPath:{0} persistentDataPath:{1} streamingAssetsPath:{2} tempPath:{3}", dataPath, persistentDataPath, streamingAssetsPath, tempPath); #if UNITY_ANDROID GameControler.InitGame(tempPath, streamingAssetsPath); #elif UNITY_IPHONE GameControler.InitGame(tempPath, streamingAssetsPath); #else GameControler.InitGame(dataPath, streamingAssetsPath); #endif GlobalVariables.Instance.IsMobile = true; GameControler.StartGame(); LogicSystem.SetLoadingBarScene("LoadingBar"); //LogicSystem.PublishLogicEvent("ge_change_scene", "game", 6); Application.LoadLevel("Loading"); } } catch (Exception ex) { LogicSystem.GfxLog("GameLogic.Start throw exception:{0}\n{1}", ex.Message, ex.StackTrace); } }
internal void RestartLogic() { try { LogicSystem.SetLoadingBarScene("LoadingBar"); // change scene to login LogicSystem.PublishLogicEvent("ge_change_scene", "game", 0); m_IsInit = true; } catch (Exception ex) { LogicSystem.LogErrorFromGfx("[Error]:Exception:{0}\n{1}", ex.Message, ex.StackTrace); } }
private void StartLogic() { try { ArkProfiler.Start("StartLogic"); // initialize all sub system of game, load data from world system GameControler.InitLogic(); // start game logic thread GameControler.StartLogic(); // load ui data table from disk UIManager.Instance.Init(); // store name of loading bar scene to game logic thread LogicSystem.SetLoadingBarScene("LoadingBar"); #if LoadDataTableFromCache //CleanupCachedTables(); #endif // manual change to loading scene if not in shipping mode if (!GlobalVariables.Instance.IsPublish) { UnityEngine.SceneManagement.SceneManager.LoadScene("Loading"); } ArkProfiler.Stop("StartLogic"); m_IsInit = true; // unload all windows, then show login window LogicSystem.EventChannelForGfx.Publish("ge_show_login", "ui"); } catch (System.Exception ex) { // at this time, logic queue may not initialize yet UnityEngine.Debug.LogErrorFormat("[Error]:Exception:{0}\n{1}", ex.Message, ex.StackTrace); LogicSystem.LogErrorFromGfx("[Error]:Exception:{0}\n{1}", ex.Message, ex.StackTrace); } }