GameObjects have some Components that make them behave in a certain way. For instance, select Main Camera and look at the Inspector panel. One of the Components is the Camera. Without that Component, it will cease being a camera. It would still be a GameObject in your scene, just no longer a functioning camera.
Any Component of any GameObject is just a script that defines a class, whether you wrote the script or the Unity's programmer did. We just aren't supposed to edit the scripts that Unity wrote. This means that all the properties we see in Inspector are just variables of some type. They simply store data that will be used by some methods.
When we add our script to a GameObject, the name of our script shows up in the Inspector panel as a Component. Unity makes a couple of small changes. You might have noticed that when we added LearningScript
to Main Camera, Unity actually showed it in the Inspector panel as Learning Script. Unity added a space to separate the words of the name. Unity does this modification to the variable names, too. Notice that the variable number1
is shown as Number 1, and number2
as Number 2. Unity capitalizes the first letter as well. These displayed changes improve readability in Inspector.
There are two situations when you can modify a property value:
When you are in the Play mode, you will see that your changes take effect immediately in real time. This is great when you're experimenting and want to see the results.
When you are in the development mode, changes you make to the property values will be saved by Unity. This means that if you quit Unity and restart it again, the changes will be retained. Of course you won't see the effect of your change until you click on Play.
If you desire to undo the changes you've made in the Inspector panel, you can reset the values to the default values assigned in your script. Click on the Cog icon (the gear) on the far right of the Component script, and then select Reset as shown in the following screenshot:
18.216.151.164