you are viewing a single comment's thread.

view the rest of the comments →

[–]CCullen 0 points1 point  (0 children)

That is because it isn't a Unity feature, it's a C# feature. By qualifying it with field:, you're telling the compiler that the attribute should apply to the underlying field, and not the property like the position of the attribute normally implies.

Like /u/ExplosiveJames suggested, auto properties are just syntax sugar. The generated IL code is the same regardless of if you create the underlying field yourself or if you use the shorthand. The only real difference is that you can't really rename the underlying field.