using System; using System.Collections; using System.Reflection; using UnityEngine; using GFGGame.Launcher; using System.Collections.Generic; using HybridCLR; using System.Linq; using YooAsset; namespace GFGGame { public class HotUpdateCodeLoader : SingletonMonoBase { public static List AOTMetaAssemblyNames { get; } = new List() { "mscorlib.dll", "System.dll", "System.Core.dll", "Game.Launcher.dll", "ThirdParty.dll" }; public Type[] allTypes; public Type[] GetTypes() { return this.allTypes; } private void Awake() { DontDestroyOnLoad(this.gameObject); } public void StartLoad() { Debug.Log("StartLoad - WebGL version (no hot update)"); StartCoroutine(LoadGameScene()); } IEnumerator LoadGameScene() { // 这里可以添加一些加载前的准备工作 Debug.Log("Preparing to load game scene..."); // 直接加载游戏场景 var sceneHandle = YooAssets.LoadSceneAsync("Assets/ResIn/Scene/HotUpdate.unity"); yield return sceneHandle; Debug.Log("Game scene loaded successfully"); } } }