Access to Unity 'Magic' methods like 'OnValidate' in ItemVisuals classes #374
ExpLuuk
started this conversation in
Feature Requests
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
This might be similar/related to request #186, but considering a much smaller change I decided to file this as a different request. Feel free to move/merge.
What
Like the title states, I think it'd be a good idea to have access to the 'magic' Unity methods like OnValidate, OnEnable, OnDisable, etc.
Why
tl;dr
Like as seen in the default Button prefab that is shipped with Nova, the ItemVisuals class (in this case, the ButtonVisuals) contains many relevant visual settings. Not only references to specific parts of said Button, for example the Label or an Icon, but also information about the styling of the Button like its color.
However, also as seen in the default Button prefab, changing the color in the ButtonVisuals (or any class derived from ItemVisuals) does NOT update the appearance of the Button itself. This leads to a disconnect between the initial color of the button, and the color after it has been pressed or hovered over once. It'll return to the color specified in the ButtonVisuals, which differs from the Color that it was before.
How
Preferably by allowing overriding methods like OnValidate, OnEnable, OnDisable.
Beta Was this translation helpful? Give feedback.
All reactions