Game Development Reference
In-Depth Information
Figure 5-3. The legs variable inside the script's class declaration
In the Document Outline area, on the left, you will see the new variable and its type. The next thing
you will have to do is make the addition permanent. If you look at the tab, you will see an asterisk
next to the script's name. This means there have been changes that must be saved before they can
be recognized.
3.
Click the Save icon on the toolbar, press Ctrl+S on the keyboard, or select
Save from the File menu.
Now the script has not only been saved, but it has been compiled into a form that the engine can use.
Currently, the script resides only in the Project view as a template. To put it into use, you will have to
put it on an object in the scene. For fun, you can add it to the bench. There's one more thing you will
need to do before you can.
4.
Drag the VariablesTest script from the Project view to the StoneGardenBench
in the Hierarchy view.
5.
Select the StoneGardenBench.
The new script component appears in the Inspector with the rest of the bench's components
(Figure 5-4 ).
 
Search WWH ::




Custom Search