From the course: Learning Unity 2D Scripting
Unlock the full course today
Join today to access over 22,600 courses taught by industry experts or purchase this course individually.
Inspector
- [Instructor] Now that we understand how to create a script and attach it to a game object, let's take a look at the Inspector to better understand how the Inspector works. We'll select our new sprite. As I mentioned earlier, each of the boxes in the Inspector represents a script attached to our game object. The Inspector automatically exposes public fields in our class. What that means is that the transformed script has a public vector that represents the position, the rotation, and the scale. By changing the values inside the Inspector, we can modify the values that would be set in the script. Unity does some magic behind the scenes to serialize and deserialize this data, so that we don't have to think about it. The important thing to understand is that basic, public fields in our scripts will automatically show up in the Inspector. As you can see from this window, we have in fields, vector fields, we can choose other objects inside of our project, such as the Sprite Picker, we can…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.