- Home /
Serializing variables without public or spamming serializefield
Is there a way to serialize variables without spamming serializefield or public all over the place? Currently almost al my variables are public because i didnt want to spam serializefield for every variable. But having everything public isnt exaclty ideal either.
Isnt it possible to do something like you can with comments (/ and /)?
Huh? what's the problem with spam$$anonymous$$g SerializeField
?
i spam Public
... I have to type it in front of every class! :)
that's just how code looks, it's not untidy.
Indeed, note that the annoying [System.NonSerialized]
appears basically in front of every single public variable, in most types of projects, since Unity whackily made the default the "other way"
it's just how unity code looks eh?
sorry if misunderstand you
Answer by Danixos · Jan 17, 2016 at 12:57 PM
Unfortunately not. There is no way to apply attributes to several fields at once. I wish there was, but there isn't. Keep up the good fight against indecent public exposure and spam [SerializeField]
.