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

Slow down in inspector with 'ShowIf' #163

Closed
ColorTwist opened this issue Jun 4, 2020 · 4 comments
Closed

Slow down in inspector with 'ShowIf' #163

ColorTwist opened this issue Jun 4, 2020 · 4 comments

Comments

@ColorTwist
Copy link

ColorTwist commented Jun 4, 2020

I really love Naughty Attributes!
Lately, I started a new project, I noticed that when adding one 'ShowIf' "[ShowIf("IsAnimated")]"
The whole script is getting slower, like typing, characters/numbers in any string field takes longer, like more time to process (slight delay but noticeable and annoying) compare to when removing the 'ShowIf' it works much smoother.
Is that expected behavior with 'ShowIf'?
Note that the script is kinda big with many parameters.
I am using Unity 2019.3.11

@snorrsi
Copy link

snorrsi commented Jun 4, 2020

@ColorTwist check out issue #133 .. seems to be the same problem. Easy quick fix workaround would be to remove the ShowIf usage , use Header instead or labels. Check out my answer in the other thread which explains roughly how I fixed it for myself

@ColorTwist
Copy link
Author

oh, i see, yeah the same issue.
Currently, I am removing Naughty Attributes as for me, the inspector becomes too slow and annoying.
I use the 'ShowIf' pretty much, one of my favorites.

@dbrizov
Copy link
Owner

dbrizov commented Jun 5, 2020

Same as #133
I know about this issue. The problem is that I am not doing any caching at all. I need to go through the attributes one by one, check what is slow and fix it. I am actually surprised that reflection is so slow, there's not that much code there. I will try to fix it in the next release.

@dbrizov dbrizov closed this as completed Jun 5, 2020
@NeatWolf
Copy link

NeatWolf commented Jul 3, 2020

Thanks for the asset @dbrizov !

I'm on v2, ShowIf+Box, and experiencing the same issue on a gaming rig!
Using Unity 2019.4.2f1 (LTS)
I would gladly pay in the Asset Store to support you in the development.

At this point some caching is really mandatory I guess (I believe ODIN is already doing that).

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

4 participants