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

Property Height Not Updating Immediately [BUG] #9

Closed
chadefranklin opened this issue Mar 28, 2022 · 2 comments
Closed

Property Height Not Updating Immediately [BUG] #9

chadefranklin opened this issue Mar 28, 2022 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@chadefranklin
Copy link
Contributor

chadefranklin commented Mar 28, 2022

What happened?

When drawing an array of serializable classes (as SerializeField) that contains a SubclassSelector, the property height does not update immediately when changing the type. The weird part is that logging "Debug.Log(EditorGUI.GetPropertyHeight(property,true));" did show it updating immediately. I also wrote my own Custom Property Drawer which does not have this issue, though I cannot figure out why. I have attached a video of the issue.

bandicam.2022-03-28.09-34-47-997.mp4

Here is a video of my version without the issue:

bandicam.2022-03-28.10-03-44-584.mp4

and the code:

https://gist.github.com/chadefranklin/cd2e6c4d89928ce25274395ff8690f9a

Package Version

1.1.2

Unity Version

2020.3.30f1

@chadefranklin chadefranklin added the bug Something isn't working label Mar 28, 2022
@mackysoft
Copy link
Owner

I have tried to reproduce the problem on my end, but could not.

One possibility is that the process is delegate when the item is selected and is out of the PropertyDrawer.OnGUI cycle, so it is not redrawing properly.
image


The following file is the unitypackage for this branch.
In this package, serializedObject.Update() is called when an item is selected.

This may solve the issue.

SerializeReference-Extensions.zip

@chadefranklin
Copy link
Contributor Author

chadefranklin commented Apr 1, 2022

Thanks for the help, that may have solved it though I can't tell as I did update my project to 2020.3.32 and this was in the release notes for 2020.3.31:

image

I'll close the issue though as the problem is resolved.

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