When editing a get/set property action and the agent is null the method selector browser will disable entries for types that do not contain/inherit at least one static property.
This happens because Internal_GetMethodSelectionMenu() adds a disabled menu entry if not suitable methods were found. As it is called twice, first for static then for instance methods, the resulting menu will contain first a disabled entry for the type itself, than a list of the instance methods (assuming there are such).
But then the GUI when processing the tree uses that first disabled entry as the type’s section header, which effectively hides all the other entries.
There might be other places were this mismatch between the method selector and the UI could lead to similar problems. The selector for regular methods hides the bug because all types have static methods inherited from object.
I’ve patched it by commenting the line that adds the disabled menu item: menu.AddDisabledItem(new GUIContent(subMenu + type.FriendlyName()) );
This of course removes altogether the types without suitable members from the menu tree. I know that the disabled entries are there by design (and agree with the point), but I would also suggest to make that behavior driven by an user option.
Indeed, I initially thought that when the agent is null, to show only instance members since the agent is null, but probably showing everything regardless of agent could be a better idea.
I don’t really like adding a lot of options (I can’t even think how an option for this could be called to be honest:P ). As such, maybe I will just make the same change you did and disregard the disabled items. It will make things more “freeform”, but also a bit less “informative” in certain cases where the same method is used though. I will let it work with it a bit and see how it “feels” 🙂
Thanks for your suggestion!
Join us on Discord: https://discord.gg/97q2Rjh
Author
Posts
Viewing 2 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic.
Login
Register
By registering on this website you agree to our Privacy Policy.