HotUpdateCodeLoader.cs 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. using System;
  2. using System.Collections;
  3. using System.Reflection;
  4. using UnityEngine;
  5. using GFGGame.Launcher;
  6. using System.Collections.Generic;
  7. using System.Linq;
  8. using YooAsset;
  9. namespace GFGGame
  10. {
  11. public class HotUpdateCodeLoader : SingletonMonoBase<HotUpdateCodeLoader>
  12. {
  13. public static List<string> AOTMetaAssemblyNames { get; } = new List<string>()
  14. {
  15. "mscorlib.dll",
  16. "System.dll",
  17. "System.Core.dll",
  18. "Game.Launcher.dll",
  19. "ThirdParty.dll"
  20. };
  21. private void Awake()
  22. {
  23. DontDestroyOnLoad(this.gameObject);
  24. }
  25. public void StartLoad()
  26. {
  27. StartCoroutine(LoadGameScene());
  28. }
  29. IEnumerator LoadGameScene()
  30. {
  31. // 这里可以添加一些加载前的准备工作
  32. // 直接加载游戏场景
  33. var sceneHandle = YooAssets.LoadSceneAsync("Assets/ResIn/Scene/HotUpdate.unity");
  34. yield return sceneHandle;
  35. }
  36. }
  37. }