using AlicizaX.Runtime; using UnityEngine; using System; using System.IO; using System.Collections; using System.Collections.Generic; using System.Reflection; using System.Threading.Tasks; using YooAsset; using Cysharp.Threading.Tasks; using Game.Config; using Game.Config.Tables; using Luban; using UnityEngine.SceneManagement; namespace GameLogic { public interface ITestEvent : IEvent { } public static class HotfixEntry { private static TablesComponent tablesComponent; private static List _hotfixAssembly; public static List HotfixAssembly => _hotfixAssembly; public static void Entrance(object[] objects) { Log.Info("HotFix Logic Entry!"); LoadConfig(); _hotfixAssembly = (List)objects[0]; new GameObject().AddComponent(); GameApp.Scene.LoadScene("Map1000", LoadSceneMode.Additive, false, 100, CallBack, false, ProgressCallBack); } private static void ProgressCallBack(float obj) { Log.Info(obj); } private static void CallBack(SceneHandle obj) { } static async void LoadConfig() { tablesComponent = new TablesComponent(); tablesComponent.Init(GameApp.Config); await tablesComponent.LoadAsync(ConfigBufferLoader); } /// /// 加载二进制配置表 /// /// /// private static async Task ConfigBufferLoader(string file) { var textAsset = await GameApp.Resource.LoadAssetAsync(file); byte[] bytes = textAsset.bytes; GameApp.Resource.UnloadAsset(textAsset); return ByteBuf.Wrap(bytes); } } }