
上QQ阅读APP看书,第一时间看更新
Assigning values while declaring a variable
Add some more variables to LearningScript
using the types shown in the previous chart. While declaring the variables, assign them values as shown in the following screenshot. See how they are presented in the Inspector panel. These are all public variables, so they'll appear in the Inspector panel.

This screenshot shows what Unity presents in the Inspector panel:

The variables are displayed in the Inspector panel with the values set by default in the code. Remember that from now on, the value in the Inspector panel will override the value in the code, so if you decide to change your code a little, the value in Inspector will stay as it was initially.