Пример #1
0
 public static string GetGlobal()
 {
     try
     {
         GameObject config    = (GameObject)ResourcesHelper.Load("KV");
         string     configStr = GameObjectHelper.GetTextAsset(config, "GlobalProto").text;
         return(configStr);
     }
     catch (Exception e)
     {
         throw new Exception($"load global config file fail", e);
     }
 }
Пример #2
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, 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();
            }
        }