This commit is contained in:
2025-09-18 10:15:40 +08:00
parent 37399df8c9
commit 566accac4f
34 changed files with 3953 additions and 45 deletions

View File

@@ -8,8 +8,8 @@ public class GameStart : MonoBehaviour
SceneHandle sceneHandle;
void Start()
{
DontDestroyOnLoad(gameObject);
StartCoroutine(LoadScene());
//StartCoroutine(LoadNetWorkManager());
StartCoroutine(LoadUIManager());
}
IEnumerator LoadScene()
@@ -19,6 +19,7 @@ public class GameStart : MonoBehaviour
sceneHandle.Completed += (handle) =>
{
handle.ActivateScene();
StartCoroutine(LoadNetWorkHUD());
};
yield return sceneHandle;
}
@@ -33,13 +34,12 @@ public class GameStart : MonoBehaviour
};
yield return _handle;
}
IEnumerator LoadNetWorkManager()
IEnumerator LoadNetWorkHUD()
{
AssetHandle _handle = YooAssets.LoadAssetAsync<GameObject>("MyRoomManager");
AssetHandle _handle = YooAssets.LoadAssetAsync<GameObject>("MyNetWorkHUD");
_handle.Completed += (handle) =>
{
GameObject go = Instantiate((GameObject)_handle.AssetObject);
DontDestroyOnLoad(go);
GameObject go = Instantiate((GameObject)_handle.AssetObject,GameManager.Inst.MainUICanvas.transform);
Debug.Log(_handle.AssetObject);
};
yield return _handle;
@@ -47,7 +47,7 @@ public class GameStart : MonoBehaviour
// Update is called once per frame
void Update()
{
if(sceneHandle!=null && !sceneHandle.IsDone)
if(sceneHandle!=null && sceneHandle.IsValid)
{
Debug.Log(sceneHandle.Progress);
}