111
This commit is contained in:
@@ -2,34 +2,37 @@ using Cysharp.Threading.Tasks;
|
||||
using UnityEngine;
|
||||
using YooAsset;
|
||||
|
||||
public class Boot : MonoBehaviour
|
||||
namespace Tuan.GameFramework
|
||||
{
|
||||
public Camera MainCamera;
|
||||
public EPlayMode PlayMode = EPlayMode.EditorSimulateMode;
|
||||
void Awake()
|
||||
public class Boot : MonoBehaviour
|
||||
{
|
||||
#if UNITY_EDITOR
|
||||
//PlayerPrefs.DeleteAll();
|
||||
#endif
|
||||
Application.targetFrameRate = 60;
|
||||
Application.runInBackground = true;
|
||||
DontDestroyOnLoad(MainCamera);
|
||||
}
|
||||
async void Start()
|
||||
{
|
||||
bool updateSuccess = await PatchManager.Inst.StartOperation(PlayMode);
|
||||
if (updateSuccess)
|
||||
await EnterGame();
|
||||
}
|
||||
private async UniTask EnterGame()
|
||||
{
|
||||
Debug.Log("EnterGame");
|
||||
var assetHandle = YooAssets.TryGetPackage("Main").LoadSceneAsync("Test");
|
||||
await assetHandle.ToUniTask();
|
||||
if (assetHandle.Status == EOperationStatus.Succeed)
|
||||
public Camera MainCamera;
|
||||
public EPlayMode PlayMode = EPlayMode.EditorSimulateMode;
|
||||
void Awake()
|
||||
{
|
||||
assetHandle.ActivateScene();
|
||||
PatchEvent.ClosePatchWindow();
|
||||
#if UNITY_EDITOR
|
||||
//PlayerPrefs.DeleteAll();
|
||||
#endif
|
||||
Application.targetFrameRate = 60;
|
||||
Application.runInBackground = true;
|
||||
DontDestroyOnLoad(MainCamera);
|
||||
}
|
||||
async void Start()
|
||||
{
|
||||
bool updateSuccess = await PatchManager.Inst.StartOperation(PlayMode);
|
||||
if (updateSuccess)
|
||||
await EnterGame();
|
||||
}
|
||||
private async UniTask EnterGame()
|
||||
{
|
||||
Debug.Log("EnterGame");
|
||||
var assetHandle = YooAssets.TryGetPackage("Main").LoadSceneAsync("Test");
|
||||
await assetHandle.ToUniTask();
|
||||
if (assetHandle.Status == EOperationStatus.Succeed)
|
||||
{
|
||||
assetHandle.ActivateScene();
|
||||
PatchEvent.ClosePatchWindow();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user