| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354 |
- 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<HotUpdateCodeLoader>
- {
- public static List<string> AOTMetaAssemblyNames { get; } = new List<string>()
- {
- "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");
- }
- }
- }
|