Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Injection功能在Unity2019打包之后不生效问题 #247

Open
chenguangcc opened this issue Jan 5, 2022 · 1 comment
Open

Injection功能在Unity2019打包之后不生效问题 #247

chenguangcc opened this issue Jan 5, 2022 · 1 comment

Comments

@chenguangcc
Copy link

chenguangcc commented Jan 5, 2022

Unity升级到2019.4.10f1之后, Injection功能在Editor状态生效,打PC包和安卓包之后不生效
查找到原因:
Unity2019版本在打包之后会在library目录下生成PlayerScriptAssemblies临时目录存放原来ScriptAssemblies下的dll,导致Injection不生效
尝试修改:
1.将Inject路径修改为PlayerScriptAssemblies,不生效
2.InjectAll之后调用EditorUtility.RequestScriptReload(),Inject成功了但是包体闪退了,反编译dll之后查看发现打包之后生成的方法体和Editor下生成的不一样,会有一个Discarded unreachable code的提示,还有一些Error导致闪退;
1

xLua也有同样的问题
Tencent/xLua#691
Tencent/xLua#732
Tamsiree/xLua@799a4fe
Tencent/InjectFix#331

@stzb321
Copy link

stzb321 commented Jun 1, 2022

2019后自行实现IPostBuildPlayerScriptDLLs 接口,在OnPostBuildPlayerScriptDLLs回调里面inject实际平台的dll

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants