Unityscript : var and public var

Greetings,

is there a difference between var and public var ?

  • Yes : which are them ?
  • No.

No.

–Eric

Acknowledged, thanx you !

As pointed out, compile-wise there is no difference. Quality of code though, in my opinion, is enhanced by explicitly marking fields as public. This improves readability by having class fields written/viewed differently than local method variables. Being in that habit also helps when you work with or port between multiple languages as they all have their own rules (e.g., C# the default state is “private” if you do not indicate scope) because all your work is explicitly marked.

Not bad, I will do that from now :wink: