[Unity][FairyGUI][ILRuntime]热更新报错提示添加自动生成代码GList.itemRenderer问题

在Unity项目使用FairyGUI和ILRuntime进行热更新时,遇到在ILRuntimeWrapper.cs的RegistDelegate()函数中添加GList.itemRenderer代码导致的错误。错误提示需要确认代码正确插入,并探讨了如何在GList中添加不同类型的对象和设置默认遍历事件。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

在热更新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>();

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值