Beispiel #1
0
 void Init()
 {
     GameStateMgr.LoadState();
     DataMgr.LoadAllData();
     SoundManager.Init();
     DialogStateManager.Init();
     PopupStateManager.Init();
     PersistMgr.Init();
     UnityEngine.Random.InitState((int)System.DateTime.UtcNow.Ticks);
     if (!launchSingle)
     {
         //检查更新,进入主界面
         DialogStateManager.ChangeState(DialogStateManager.ConnectDialogState);
         GameStart();
     }
     else
     {
         //如果当前场景就是关卡场景,那么直接调用,否则需要先加载对应的关卡场景
         if (Loader.Instance == null)
         {
             LevelData lev = Ins.DataMgr.GetLevelData(level);
             U3D.LoadScene(lev.Scene, () => {
                 LevelHelper.OnLoadFinishedSingle(level);
             });
         }
         else
         {
             LevelHelper.OnLoadFinishedSingle(level);
         }
     }
 }
Beispiel #2
0
 void Start()
 {
     UpdateHelper.LoadCache();
     GameStateMgr.LoadState();
     DataMgr.LoadAllData();
     ResMng.Reload();
     SoundManager.Init();
     DialogStateManager.Init();
     PopupStateManager.Init();
     DialogUtils.Ins.Init();
     UnityEngine.Random.InitState((int)System.DateTime.UtcNow.Ticks);
     DialogStateManager.ChangeState(DialogStateManager.ConnectDialogState);
     if (checkUpdate == null)
     {
         checkUpdate = StartCoroutine(CheckNeedUpdate());
     }
 }