xLua
xLua copied to clipboard
08_Hotfix实例报错
LuaException: xlua.access, no field __Hotfix0_Update stack traceback: [C]: in field 'access' [string "Init"]:101: in field 'hotfix' [string "chunk"]:2: in main chunk
已执行以下步骤:
1.宏定义:添加 HOTFIX_ENABLE 到 'Edit > Project Settings > Player > Other Settings > Scripting Define Symbols'。 (注意:各平台需要分别设置)
2.生成代码:执行 'XLua > Generate Code' 菜单,等待Unity编译完成。
3.注入:执行 'XLua > Hotfix Inject In Editor' 菜单。注入成功会打印 'hotfix inject finish!' 或者 'had injected!' 。
一年之前的xlua版本还可以正常运行,自从更新了asmdef特性之后就坏了
如果XluaTest类之前不添加[Hotfix]标签,
在下面脚本统一添加标签,发现hotfix不生效,在旧版本是生效的
{ public static class HotfixTestCfg { [Hotfix] public static List<Type> by_field = new List<Type>() { typeof(XluaTest), }; } }
有解决方案吗?我也遇到使用 方式二:在一个static类的static字段或者属性里头配置一个列表 不生效的问题
测试发现需要放在非Editor目录就有效了,unity2021.3.21