Tencent / xLua

xLua is a lua programming solution for C# ( Unity, .Net, Mono) , it supports android, ios, windows, linux, osx, etc.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Hotfix] 有时需要放到非Editor目录才生效

jerry-zeng opened this issue · comments

方式二的配置方式,静态类静态属性加[Hotfix],放在Editor目录,Unity2018.4运行挺正常的,文档里也写了高版本Unity需要放Editor目录。

现在升级到Unity2021.3 + xlua2.1.16,同样的代码,再放Editor目录就HotfixInject无效(编辑器和安卓都一样),显示"had injected!",dll的md5也确实变了,但是实际还是提示no field _Hotfix0。手头没现成的dll反编译工具,所以看不到dll变化纠结了一整天,无意中看到有人说放在非Editor目录可以,试了下确实可以。

我用XLua/Examples跑也正常,那里是放Editor目录的。

具体原因未知,跟XLua.Core.dll有关系呢?还是Unity版本有关系? 总之,配置脚本可能不一定非要放Editor目录。