Learn the difference between public, private and serialized - variables visibility in Unity

Опубликовано: 13 Октябрь 2024
на канале: PitiIT
1,695
76

If you want to finally learn if you should use [SerializedField] private or public you are in good place! We'll not only cover how to show and hide variables in the inspector but also the most important access modifiers.

Public, private, protected, internal? Got you covered!
SerializedField, HideInInspector? Got you covered too!
Common questions and good practices? Of course!

Official C# docs about access modifiers:
https://docs.microsoft.com/en-us/dotn...
Unity docs [HideInInspector]:
https://docs.unity3d.com/ScriptRefere...
Unity docs [SerializedField]:
https://docs.unity3d.com/ScriptRefere...

#UnityScripting #AccessModifiers #Attributes

00:00 Intro
00:13 Access Modifiers (with examples)
03:45 In the Inspector
04:49 Summary
05:33 FAQ