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

Attribute won't fallback in Unity 2020 (IMGUI) #119

Closed
laurentopia opened this issue Jan 15, 2025 · 5 comments
Closed

Attribute won't fallback in Unity 2020 (IMGUI) #119

laurentopia opened this issue Jan 15, 2025 · 5 comments
Assignees
Labels
bug Something isn't working

Comments

@laurentopia
Copy link

image
image

@TylerTemp
Copy link
Owner

Hi,

this is a known issue because Unity does not fallback, documented

However, Unity only allows decorators to be loaded from top to bottom, left to right. Any drawer that does not properly handle the fallback will override PropertyDrawer follows by. Thus, ensure SaintsField is always the first decorator.

So just put SaintsField before Unity's decorator:

public bool omniscient;

[Range(1, 40), HideIf(nameof(omniscient)), InfoBox("This won't work: Unity won't fallback")] public float detectionRange;
[HideIf(nameof(omniscient)), Range(1, 40), InfoBox("This is fine: SaintsField can fallback")] public float fieldOfView;
Unity_9eTx2pPZtH.mp4

@TylerTemp TylerTemp changed the title HideIf doesn't work with Range HideIf doesn't work when after Range Jan 15, 2025
@laurentopia
Copy link
Author

This must have been fixed somewhat in newer versions.
in 2020 the slider turns into a field.
Image
Image

@TylerTemp TylerTemp changed the title HideIf doesn't work when after Range Attribute won't fallback in Unity 2020 (IMGUI) Jan 17, 2025
@TylerTemp TylerTemp self-assigned this Jan 17, 2025
@TylerTemp TylerTemp added the bug Something isn't working label Jan 17, 2025
@TylerTemp
Copy link
Owner

Bug confirmed. I'll check it soon

TylerTemp added a commit that referenced this issue Jan 17, 2025
TylerTemp added a commit that referenced this issue Jan 17, 2025
@TylerTemp
Copy link
Owner

Hi,

This bug has been fixed in 3.19.0

Image

@TylerTemp
Copy link
Owner

Closed as fixed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants