热更流程完成
This commit is contained in:
@@ -1,18 +1,14 @@
|
||||
using Cysharp.Threading.Tasks;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using YooAsset;
|
||||
using static UnityEngine.Rendering.VirtualTexturing.Debugging;
|
||||
|
||||
public class Boot : SingletonMono<Boot>
|
||||
public class Boot : MonoBehaviour
|
||||
{
|
||||
public List<string> DepDlls = new List<string>()
|
||||
{
|
||||
"mscorlib.dll",
|
||||
"System.dll",
|
||||
"System.Core.dll",
|
||||
"Mirror.dll"
|
||||
};
|
||||
public GameObject MainUICanvas;
|
||||
public Camera UICamera;
|
||||
public Camera MainCamera;
|
||||
public EPlayMode PlayMode = EPlayMode.EditorSimulateMode;
|
||||
void Awake()
|
||||
{
|
||||
@@ -21,6 +17,9 @@ public class Boot : SingletonMono<Boot>
|
||||
#endif
|
||||
Application.targetFrameRate = 60;
|
||||
Application.runInBackground = true;
|
||||
DontDestroyOnLoad(MainUICanvas);
|
||||
DontDestroyOnLoad(UICamera);
|
||||
DontDestroyOnLoad(MainCamera);
|
||||
}
|
||||
async void Start()
|
||||
{
|
||||
@@ -28,10 +27,14 @@ public class Boot : SingletonMono<Boot>
|
||||
GameManager.Inst.MainUICanvas = MainUICanvas;
|
||||
bool updateSuccess = await PatchManager.Inst.StartOperation(PlayMode);
|
||||
if (updateSuccess)
|
||||
EnterGame();
|
||||
await EnterGame();
|
||||
}
|
||||
private void 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();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user