| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
本工具用于重写Unity引擎的二进制文件,在没有源码的情况下,可以用它实现一些功能、修复一些问题
支持Unity 2019~2022
项目可以将ProjectSettings\EngineBinaryFileRewriterSettings.asset拷贝到自己的工程中,并启用需要的功能
在项目中使用前,请运行本工程的单元测试(Window -> General -> Test Runner)验证配置是否能在项目使用的Unity版本中生效
HybridCLR要求AssetBundle开启TypeTree或者禁用AssetBundle的兼容性检查,但Unity只对异步加载提供了接口禁用(文档):
AssetBundleCreateRequest req = AssetBundle.LoadFromFileAsync(path);
req.SetEnableCompatibilityChecks(false); // 需要通过反射调用,并且存在线程竞争问题,有概率不起效本工具可以全局禁用掉AssetBundle的兼容性检查,从而让使用HybridCLR的项目可以关闭TypeTree
工程中包含了Android、iOS的开发版本和发布版本的配置。已测试版本:
卡死时的调用栈示例(有其他的可能性,主要看是否是卡在AsyncResourceUploadBlocking里):
#1 0x0000000190f53370 in _dispatch_sema4_wait () #2 0x0000000190f53a20 in _dispatch_semaphore_wait_slow () #3 0x000000011bceda44 in DarwinApi::detail::Acquire(UnityClassic::Baselib_SystemSemaphore_Handle, unsigned long long) [inlined] at /Users/bokken/build/output/unity/unity/External/baselib/builds/Source/Darwin/Baselib_SystemSemaphore_DarwinApi.inl.h:36 #4 0x000000011bceda38 in DarwinApi::Baselib_SystemSemaphore_Acquire(UnityClassic::Baselib_SystemSemaphore_Handle) [inlined] at /Users/bokken/build/output/unity/unity/External/baselib/builds/Source/Darwin/Baselib_SystemSemaphore_DarwinApi.inl.h:62 #5 0x000000011bceda38 in UnityClassic::Baselib_SystemSemaphore_Acquire(UnityClassic::Baselib_SystemSemaphore_Handle) at /Users/bokken/build/output/unity/unity/External/baselib/builds/Source/CProxy/Baselib_SystemSemaphore_CProxy.inl.h:19 #6 0x000000011b05c7bc in Baselib_CappedSemaphore_Acquire [inlined] at /Users/bokken/build/output/unity/unity/External/baselib/builds/Include/C/Internal/Baselib_CappedSemaphore_SemaphoreBased.inl.h:44 #7 0x000000011b05c7b4 in ::WaitForSignal() at /Users/bokken/build/output/unity/unity/Runtime/Threads/CappedSemaphore.h:29 #8 0x000000011b05c674 in ::AsyncResourceUploadBlocking() at /Users/bokken/build/output/unity/unity/Runtime/Graphics/AsyncUploadManager.cpp:524 #9 0x000000011b9312e0 in ::SyncAsyncResourceUpload() at /Users/bokken/build/output/unity/unity/Runtime/GfxDevice/GfxDevice.cpp:2320 #10 0x000000011bac2a44 in ::RunCommand() at /Users/bokken/build/output/unity/unity/Runtime/GfxDevice/threaded/GfxDeviceWorker.cpp:2521 #11 0x000000011bb6cc34 in GfxDeviceWorkerAutoreleasePoolProxy at /Users/bokken/build/output/unity/unity/Runtime/GfxDevice/metal/GfxDeviceMetal.mm:5876 #12 0x000000011babda08 in ::RunExt() at /Users/bokken/build/output/unity/unity/Runtime/GfxDevice/threaded/GfxDeviceWorker.cpp:375 #13 0x000000011babd928 in ::Run() at /Users/bokken/build/output/unity/unity/Runtime/GfxDevice/threaded/GfxDeviceWorker.cpp:353 #14 0x000000011babd5f0 in ::RunGfxDeviceWorker() at /Users/bokken/build/output/unity/unity/Runtime/GfxDevice/threaded/GfxDeviceWorker.cpp:332 #15 0x000000011b22562c in ::RunThreadWrapper() at /Users/bokken/build/output/unity/unity/Runtime/Threads/Thread.cpp:112 #16 0x00000001e5afe06c in _pthread_start ()
本工具通过调整信号量类中一个函数的指令规避这个问题,但是有性能损失
工程中包含了Android、iOS的发布版本的配置。已测试版本:
RefreshFQNCache会遍历所有程序集中的类型,当使用HybridCLR DHE时,可能会导致客户端卡住比较久(详见文章)
本工具可以屏蔽掉这个函数的调用,从而避免它引发的一系列问题
注意:这个函数和MovedFromAttribute有关,请确认项目没有依赖此功能,再屏蔽
工程中包含了Android、iOS的开发版本和发布版本的配置。已测试版本:
| Back | FazBrowse Home | New Git URL |