/// <summary> /// 启动热更实例,包括跨域函数注册、跨域类装配器注册、重定向方法注册 /// </summary> public void Start() { if (IsStart) { return; } else { } IsStart = true; IHotFixConfig config = this.GetAppILRuntime().GetHotFixConfig(); config.RegisterMethods?.Invoke(ILAppDomain);//注册函数适配器 CrossBindingAdaptor[] list = config.Adapters; int max = list == default ? 0 : list.Length; for (int i = 0; i < max; i++) { ILAppDomain.RegisterCrossBindingAdaptor(list[i]);//注册跨域类适配器 } #if ILRUNTIME LitJson.JsonMapper.RegisterILRuntimeCLRRedirection(ILAppDomain); //注册热更端JSON解析器 #endif ILRuntime.Runtime.Generated.CLRBindings.Initialize(ILAppDomain); //注册重定向的方法 }