HotUpdateCodeLoader.cs 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  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. using UnityEngine.SceneManagement;
  10. namespace GFGGame
  11. {
  12. public class HotUpdateCodeLoader : SingletonMonoBase<HotUpdateCodeLoader>
  13. {
  14. public static List<string> AOTMetaAssemblyNames { get; } = new List<string>()
  15. {
  16. "mscorlib.dll",
  17. "System.dll",
  18. "System.Core.dll",
  19. "Game.Launcher.dll",
  20. "ThirdParty.dll"
  21. };
  22. private void Awake()
  23. {
  24. DontDestroyOnLoad(this.gameObject);
  25. }
  26. public void StartLoad()
  27. {
  28. //StartCoroutine(LoadGameScene());
  29. Debug.Log(VersionController.Instance.package.CheckLocationValid("Assets/ResIn/Font/GameFont2/FZKTJW--GB1-0.ttf"));
  30. SceneManager.LoadScene("HotUpdate");
  31. }
  32. //IEnumerator LoadGameScene()
  33. //{
  34. // // 这里可以添加一些加载前的准备工作
  35. // // 直接加载游戏场景
  36. // Debug.Log("11111");
  37. // //var sceneHandle = YooAssets.LoadSceneAsync("Assets/ResIn/Scene/HotUpdate.unity");
  38. // //var sceneHandle = YooAssets.LoadSceneAsync("HotUpdate");
  39. // string location = "Assets/ResIn/Scene/HotUpdate";
  40. // var sceneMode = UnityEngine.SceneManagement.LoadSceneMode.Single;
  41. // var physicsMode = LocalPhysicsMode.None;
  42. // bool suspendLoad = false;
  43. // string packageName = VersionController.DefaultPackage;
  44. // SceneHandle handle = YooAssets.GetPackage(packageName).LoadSceneAsync(location, sceneMode, physicsMode, suspendLoad);
  45. // yield return handle;
  46. // Debug.Log("22222");
  47. // //yield return sceneHandle;
  48. //}
  49. }
  50. }