Skip to content

Support Unity 7000 CoreCLR - #148

Merged
mackysoft merged 5 commits into
mainfrom
feature/unity-7000-support
Oct 21, 2026
Merged

mackysoft merged 5 commits into
mainfrom
feature/unity-7000-support

Conversation

@mackysoft

@mackysoft mackysoft commented Oct 20, 2026 •

Copy link
Copy Markdown
Owner

Summary

Support Unity 7000 CoreCLR in type discovery and serialized type resolution. Keep selector headers in Unity's native field hierarchy so the Unity 7 list styles apply correctly.

Scope

  • Use CurrentAssemblies.GetLoadedAssemblies() on Unity 7000 while preserving earlier Editor versions.
  • Resolve nested serialized type names using Unity's slash-to-plus fallback, shared by both Inspector backends and menu commands.
  • Make the header a native PopupField directly under PropertyField, with the native Foldout prefix in a sibling slot. Unity owns widths, margins and indentation.
  • Add 7000.0.0a11 to Linux EditMode CI. Targeted manual runs use a separate gate; PRs retain the full required matrix.

Verification

Full Linux PR CI and required Verification check passed at 701eeaa.

Unity Editor Passed Failed Existing ignored cases
2021.3.45f2 198 0 0
6000.6.6f1 208 0 2
7000.0.0a11 208 0 2

The two ignored cases on Unity 6 and 7000 are the existing Covariance_DoesNotBoxValueTypeArguments and Contravariance_DoesNotBoxValueTypeArguments tests for the known value-type variance defect. This PR does not change those ignores or the type-filtering policy.

  • Unity 7000.0.0a11, macOS: 51 selection, menu, Undo and drawer checks passed; 5 affected native-layout, resize/focus, foldout and Prefab checks passed.
  • Actual GUI: type search/change, matching-value preservation, Undo, both Inspector backends and array null rows.
  • Actual code reload: current type definitions replaced the previous candidates, caches were recreated, and the contextual menu remained registered once.
  • Tests workflow passes actionlint; git diff --check passes.

References

Why
CoreCLR may retain assemblies from unloading code contexts in AppDomain.GetAssemblies after code reload.

What Changed
Use Unity's CurrentAssemblies API on Unity 7000 and newer when discovering generic type candidates. Keep the version-specific implementation behind a dedicated method.

Impact
Candidates come from Unity's current loaded assemblies on CoreCLR. Earlier Unity versions retain their existing discovery and filtering behavior.
Why
The CoreCLR assembly discovery path needs Linux coverage alongside the minimum and current Mono-based Unity versions.

What Changed
Add Unity 7000.0.0a11 to the existing EditMode matrix.

Impact
The Verification check now requires the Unity 7000 job as well as the existing 2021.3 and Unity 6 jobs. Release builds keep their existing Editor version.
Why
Unity 7000 serializes nested managed type names with slash separators. Direct reflection lookup cannot resolve them, leaving IMGUI labels empty and preventing the type popup from opening.

What Changed
Retry nested-name resolution using the same slash-to-plus conversion as Unity's ScriptAttributeUtility. Keep the conversion in ManagedReferenceUtility instead of requiring individual callers to normalize names.

Impact
Both Inspector backends and menu commands share the same type-name interpretation. The 51 affected type-selection, drawer, change-check and menu tests pass on Unity 7000 locally.
Why
Investigating a Unity 7000 failure should not repeat unaffected Editor versions or unrelated tests.

What Changed
Allow workflow dispatches to select an Editor version and test filter. Name the resulting gate Targeted verification so a diagnostic run cannot satisfy the full Verification requirement.

Impact
Pull requests and main still run the full required matrix. Manual diagnostics can verify the affected runtime and operations independently.
Why
Unity 7 applies list-row margins to BaseFields directly under PropertyField. An extra selector wrapper prevented those native rules from reaching the popup, making it too wide.

What Changed
Make the header itself a native PopupField. Place the existing Foldout prefix in a sibling flow slot so it keeps its own native margins and logical Foldout ownership. Detach and hide both owned elements together.

Impact
Unity calculates input widths and prefix indentation without measured offsets or layout corrections. The affected Unity 7000 checks for native geometry, resizing, focus, foldout interaction and Prefab revert pass.
@mackysoft
mackysoft marked this pull request as ready for review October 21, 2026 07:47
@mackysoft
mackysoft merged commit 27a1749 into main Oct 21, 2026
5 checks passed
@mackysoft
mackysoft deleted the feature/unity-7000-support branch October 21, 2026 07:48
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

Successfully merging this pull request may close these issues.

1 participant