handzlikchris / handzlikchris/FastScriptReload

Added fields not working with Unity editors drawn without IMGUI (ie 2022.3)

Offen
#108 1 Kommentar 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
bug
Vorherrschende Sprache
C#
Sterne
2.2k
Forks
167
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

On recent Unity versions (tested with v2022.3.10f1 on my side), Unity is no longer drawing default inspector with IMGUI (but with Visual Elements). Making the added fields feature no longer working.

This can be verified by enabling "Use IMGUI Default Inspector" in the Project Settings > Editor.
When enabled added fields feature is working again.
When disabled, as Unity is no longer calling DrawDefaultInspector, the harmony patch is no longer effective, and RenderNewlyAddedFields is no longer called.

I guess an additional patch would be needed in NewFieldsRendererDefaultEditorPatch constructor to add compatibility with the new way Unity is drawing inspectors. Probably by adding a patch to CreateInspectorGUI, where you could add the creation of a new [IMGUIContainer](https://docs.unity3d.com/ScriptReference/UIElements.IMGUIContainer-ctor.html), which would call RenderNewlyAddedFields (onGUIHandler).

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Rechercherichtung

Start with the NewFieldsRendererDefaultEditorPatch constructor and trace how DrawDefaultInspector currently leads to RenderNewlyAddedFields. Reproduce the behavior in Unity 2022.3 with Use IMGUI Default Inspector enabled and disabled, then inspect CreateInspectorGUI and IMGUIContainer integration. Done means added fields render when Unity uses the Visual Elements inspector, while existing IMGUI behavior remains working.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
csharp, unity
Bereich
game-dev, tooling
Issue-Typ
Bug
Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
35/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.