Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inspector controls doesn't work in 2022+ #12

Open
dragon122 opened this issue Jun 14, 2023 · 3 comments
Open

Inspector controls doesn't work in 2022+ #12

dragon122 opened this issue Jun 14, 2023 · 3 comments

Comments

@dragon122
Copy link

Any actions with the "+s""+i" buttons in the inspector are ignored in 2022LTS\2023

@hackerG7
Copy link

Same here

@wozhdal
Copy link

wozhdal commented Sep 4, 2024

same (2022.3.30f1)

found something : when hit +i or +s, remove button is called at the same time.
i tried to remove the remove button and +i and +s show a new item as planned.

But, when trying to add a method, another issue appear, the dropdown is empty and this error pop up:
System.NullReferenceException: Object reference not set to an instance of an object bool UnityEngine.GUI.DoControl(Rect position, int id, bool on, bool hover, GUIContent content, GUIStyle style) bool UnityEngine.GUI.DoButton(Rect position, int id, GUIContent content, GUIStyle style) bool UnityEngine.GUI.Button(Rect position, int id, GUIContent content, GUIStyle style) x 2 bool SolidUtilities.GUIHelper.CloseButton(Rect buttonRect) in ./Library/PackageCache/[email protected]/Runtime/Helpers/GUIHelper.cs:26 string UnityDropdown.Editor.DropdownMenu.DrawSearchField(Rect innerToolbarArea, string searchText) in ./Library/PackageCache/[email protected]/Editor/DropdownMenu.cs:211

I tried to add this pull request of dropdown supporting unity 2022: https://github.com/SolidAlloy/UnityDropdown/pull/3/files#diff-81cda7c4db1f47564e3c1eea4b7178c037137e20216f1920286404c139cb0a90

i tried to correct the error at GUIHelper.cs:26 with this modification :
return GUI.Button(buttonRect, GUIContent.none, new GUIStyle());
and the dropdown seems now to work.

@dragon122
Copy link
Author

Nice find.
It seems that the reason the list was cleared on any input was because during the check with ButtonData.IsAddButton == false at FoldoutList.DrawFooter the button press was invoked constantly (list.ScheduleRemove is always true?). So, to fix the button was enough to replace false to true in FoldoutList.DefaultRemoveButton at 281 line.

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

No branches or pull requests

3 participants