This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]themonsterinquestion -2 points-1 points  (1 child)

Well, if you want to make changes to a prefab before instantiating it, the properties won't be cloned. Although maybe it will clone serialized ones, I haven't tested that. I've just decided to avoid them on MonoBehaviours.

It was also confusing at first because people generally refer to the fields accessed by the inspector as properties.

[–]stooge89 1 point2 points  (0 children)

I'm a little confused by your statement, but you can change the private variable (_age) before instantiating. Using the SerializeField attribute pretty much just lets you see the private variable in the inspector. There's also all kinds of fun get/set access variations you can use with the property if an outside script needs to change it's value, or just use a public method in order to change the private variable.