This video demonstrates how we can add values to classes. In the C# programming language, a class is a collection of values. Classes can have methods, which have code, and individual values, called fields.
A field can either be public, available to other code, or private, where access is limited to only the class itself.
In C#, we can use an attribute, SerializeField, to allow Unity to change a private field. There may be cases where we want other classes to edit values, for which "public" might be better, and other cases where we only want Unity and the class itself to change value.
Unity 2023.2: Introduction to 2D Playlist: • Unity 2023.2: Introduction to 2D
Created by Dan Cox ( @DanCox )