handzlikchris / handzlikchris/FastScriptReload

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

Open
#108 1 comment 0 reactions 0 assignees View on GitHub
bug
Dominant language
C#
Stars
2.2k
Forks
167
PR merge metrics
No merged PRs in 30d

Description

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).

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.