| 
 
 
 
 在热更新ILRuntime中使用了GList.itemRenderer,Unity编辑器 运行提示错误  
KeyNotFoundException: Cannot find convertor for FairyGUI.ListItemProvider
  
   
 
在Unity项目中ILRuntimeWrapper.cs的void RegistDelegate()函数中添加 下面这段代码  
appdomain.DelegateManager.RegisterDelegateConvertor<FairyGUI.ListItemProvider>((act) =>
{
    return new FairyGUI.ListItemProvider((index) =>
    {
        return ((Func<System.Int32, System.String>)act)(index);
    });
});
  
 
Unity编辑器 运行提示错误,报错提示  
KeyNotFoundException: Cannot find Delegate Adapter for:uicreatetroops.GetListItemResource(Int32 index), Please add following code:
appdomain.DelegateManager.RegisterFunctionDelegate<System.Int32, System.String>();
  
   
?在Unity项目中ILRuntimeWrapper.cs的void RegistDelegate()函数中添加 下面这段代码  
appdomain.DelegateManager.RegisterFunctionDelegate<System.Int32, System.String>();  
 
 
确保 是  
在Unity项目中ILRuntimeWrapper.cs的void RegistDelegate()函数中添加 下面这段代码  
...
void RegistDelegate()
{
...
        appdomain.DelegateManager.RegisterDelegateConvertor<FairyGUI.ListItemProvider>((act) =>
        {
            return new FairyGUI.ListItemProvider((index) =>
            {
                return ((System.Func<System.Int32, System.String>)act)(index);
            });
        });
        
        appdomain.DelegateManager.RegisterFunctionDelegate<System.Int32, System.String>();
...
}
...  
热更新ILRuntime自动报错 生成代码。。。  
                
        
    
 
 |