I read a c# programming book 《c# effective 50 wayss…》,it suggests to create properties instead of
public data members ,like field variable. anyone can tell me why not unity does this way ?
ps: i think create public filed variable is not a good idea.
There are likely a bunch of reasons, but at least one is todo with serialization. Properties are functions, which means they can introduce side effects, which is problematic for serialization, especially the high performance, in-place serialization that is designed into the Unity object system.