O'Reilly logo

Mastering Unity Scripting by Alan Thorn

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Property exposing

By default, the Object Inspector displays all public member variables of a class unless it's in Debug mode or a private member is explicitly marked with the SerializeField attribute and in these cases private member variables will be shown too:

Property exposing

Property accessing from the Object Inspector

However, C# properties will never be displayed by default, either in Release or Debug mode. As discussed in Chapter 1, Unity C# Refresher, C# properties act like accessor functions to a variable. They essentially permit validation on each get and set operation because every get and set operation entails an internal function call. However, regardless ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required