This commit is contained in:
2025-09-17 18:56:28 +08:00
commit 54c72710a5
5244 changed files with 5717609 additions and 0 deletions

View File

@@ -0,0 +1,55 @@
using System.Collections;
using UnityEngine;
using UnityEngine.SceneManagement;
using YooAsset;
public class GameStart : MonoBehaviour
{
SceneHandle sceneHandle;
void Start()
{
StartCoroutine(LoadScene());
//StartCoroutine(LoadNetWorkManager());
StartCoroutine(LoadUIManager());
}
IEnumerator LoadScene()
{
sceneHandle = YooAssets.LoadSceneAsync("MirrorRoomOffline");
//sceneHandle = YooAssets.LoadSceneAsync("Game");
sceneHandle.Completed += (handle) =>
{
handle.ActivateScene();
};
yield return sceneHandle;
}
IEnumerator LoadUIManager()
{
AssetHandle _handle = YooAssets.LoadAssetAsync<GameObject>("UIManager");
_handle.Completed += (handle) =>
{
GameObject go = Instantiate((GameObject)_handle.AssetObject);
DontDestroyOnLoad(go);
Debug.Log(_handle.AssetObject);
};
yield return _handle;
}
IEnumerator LoadNetWorkManager()
{
AssetHandle _handle = YooAssets.LoadAssetAsync<GameObject>("MyRoomManager");
_handle.Completed += (handle) =>
{
GameObject go = Instantiate((GameObject)_handle.AssetObject);
DontDestroyOnLoad(go);
Debug.Log(_handle.AssetObject);
};
yield return _handle;
}
// Update is called once per frame
void Update()
{
if(sceneHandle!=null && !sceneHandle.IsDone)
{
Debug.Log(sceneHandle.Progress);
}
}
}