Unity-Editor-Toolbox icon indicating copy to clipboard operation
Unity-Editor-Toolbox copied to clipboard

[Feature Request] ShowNonSerializedField

Open KospY opened this issue 2 years ago • 1 comments

Would be nice to get an attribute to show non serialized fields in inspector. ODIN and NaughtyAttributes have this option, and it's quite handy for debugging and other specific cases.

Something like:

[ShowNonSerializedField]
private int myInt = 1;

[NonSerialized, ShowNonSerializedField]
public int myInt2 = 10;

Thanks!

KospY avatar Jun 24 '23 09:06 KospY

Hello, thanks for the issue. I agree, this is a really nice feature, but the reason why this is not implemented is quite simple - performance. NaughtyAttributes and Odin (just a guess, don't know the source code) use Reflection to find and process all properties and fields in the active component/type. I wanted to avoid it and keep Toolbox as lightweight as possible. In this case, I can achieve it differently, perhaps with a dedicated attribute to mark complex types. Anyway, I can't promise when this will be implemented.

arimger avatar Jun 26 '23 20:06 arimger