Repository navigation
Fix Unity 6 native class resolver hooks - #31
Merged
Fernthedev merged 1 commit intoOct 18, 2026
Merged
Fernthedev merged 1 commit into
Fernthedev merged 1 commit into
Conversation
FrozenAlex
marked this pull request as ready for review
October 18, 2026 02:07
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
beatsaber-hook 9.3.0 separates its callable compatibility APIs from Unity's native class entry points. Custom-types still hooks the compatibility pointer addresses, so Unity's internal calls can bypass custom-type handling and fail during class initialization.
Update the Unity 6 hooks to target the native entry points with their actual signatures:
Class_FromIl2CppTypeNativeasIl2CppClass*(const Il2CppType*, bool), preservingthrowOnErrorwhen forwarding ordinary types.Class_InitNativeasvoid(Il2CppClass*), retaining the existing skip for registered custom classes.^9.3.0and update the resolved dependency and artifact URLs. Earlier Unity branches retain their existing hook signatures.Companion to beatsaber-hook #67, released in 9.3.0. Consumers can continue using the existing callable APIs.
Validation:
src/register.cppimplementation was previously tested on Quest 3 / Beat Saber 1.45.3 / Unity 6000.3.19f1 with the companion hook changes: two fresh processes each passed 752 resolver checks and 3,048 checks across 277 registered custom classes, followed by 30 seconds without a fatal log entry.The headset tests used the previously built local hook/custom-types pair; this PR's fresh build against the published 9.3.0 artifact has not been separately deployed. Uncached generic error paths and the complete registered test suite were not exercised. An initial diagnostic-time crash during live observer patching was excluded; the corrected harness produced the clean repeat results above.