FixPluginTypesSerializationDebug
Fork of FixPluginTypesSerialization to make it compatible with development builds. Fix custom Serializable structs and such not properly getting deserialized by Unity
模組介紹 作者原文
FixPluginTypesSerialization
Hook into the native Unity engine for adding BepInEx plugin assemblies into the assembly list that is normally used for the assemblies sitting in the game Managed/ folder.
This solve a bug where custom Serializable structs and such stored in plugin assemblies are not properly getting deserialized by the engine.
Installation
- Copy the BepInEx\patchers\FixPluginTypesSerialization folder into your BepInEx/patchers folder.
Adding your own Unity version support
This project only works with official releases of Unity 64 bit versions from 5.0.0 to 2023.2.5.
If you want to add your own version, know that I don't have the free time and the will to investigate on how to help you, all I can provide is the text below.
My best advice is to get ida or ghidra and get the unity pdb from their symbol servers (just google unity symbol server for that), and read the pseudo C code from the decompiler, find the assembly lists they populate from the Manager/ folder, and add the bepinex plugins/ assemblies to those assembly lists.
If the game uses custom Unity version or it's not supported and doesn't have pdb you can manually change offsets in the config. But it's not quite easy, your best bet would be getting the closest release verison that has pdb and open it in ida/ghidra find the funtions you need by name, then search for the bytes of the function in your Unity version. The start address of the function would be your offset (at least in ghydra just the address is not the offset, you would also need to look at the start of the file and sse the first address and subtract that from your function address to get the offset).
That's basically all this project does.
Be warned that Unity's implementation changes greatly from version to version, so you may have to completely change the way things are approached for suported versions.
An alternative path to messing with Unity internals directly is to investigate on how to setup a Virtual File System, other modding communities like Skyrim have done it for mod management purposes.
The idea is to redirect all system calls so that the bepinex plugin folder is as if it were in the Managed one.
Special Thanks
- Horse for the original code base
- 0x0ade for the NativeLibraryHelper class
- knah
- KingEnderBrine
- Twiner
- NebNeb for the icon
安裝與使用 安裝:BepInEx 外掛
- 本站下載的壓縮包就是模組本體,通常是 BepInEx 外掛(解壓後得到 .dll 或外掛資料夾)。
- 建議流程:用社群模組管理器(如 r2modman)選中本遊戲後匯入該模組,管理器會自動裝好 BepInEx 前置並處理依賴。
- 手動流程:先在遊戲目錄裝好 BepInEx 載入器,再把解壓出的 .dll 或外掛資料夾放進 BepInEx/plugins/。
- 啟動遊戲,BepInEx 控制台會列印載入日誌;確認這個模組出現在日誌裡即為安裝成功。
帶「前置依賴」的模組需要一併安裝,否則不會載入。功能開關通常在遊戲內或外掛自帶的設定檔裡調整。
下面這些內容需要先安裝,否則該模組不會生效: