Beispiel #1
0
        public static async void StartHotfix()
        {
            Log.Debug($"当前使用的是Mono模式");

            var code = await AssetBundles.Default.LoadAssetAsync(codeAssetName, codePrefabName) as GameObject;

            if (code)
            {
                Assembly.Load(GameObjectHelper.GetTextAsset(code, CoreDll).bytes, GameObjectHelper.GetTextAsset(code, CorePdb).bytes);
                Assembly.Load(GameObjectHelper.GetTextAsset(code, AssetBundleDll).bytes, GameObjectHelper.GetTextAsset(code, AssetBundlePdb).bytes);
                Assembly.Load(GameObjectHelper.GetTextAsset(code, MessageDll).bytes, GameObjectHelper.GetTextAsset(code, MessagePdb).bytes);
                Assembly.Load(GameObjectHelper.GetTextAsset(code, ConfigDll).bytes, GameObjectHelper.GetTextAsset(code, ConfigPdb).bytes);
                Assembly.Load(GameObjectHelper.GetTextAsset(code, BehaviorTreeDll).bytes, GameObjectHelper.GetTextAsset(code, BehaviorTreePdb).bytes);
                Assembly.Load(GameObjectHelper.GetTextAsset(code, FairyGUIDll).bytes, GameObjectHelper.GetTextAsset(code, FairyGUIPdb).bytes);

                var mainAssembly = Assembly.Load(GameObjectHelper.GetTextAsset(code, HotfixDll).bytes, GameObjectHelper.GetTextAsset(code, HotfixPdb).bytes);
                var start        = new MonoStaticMethod(mainAssembly.GetType("DCET.Init"), "Start");
                start.Run();
            }
        }