Game Development Reference
In-Depth Information
A third way is to select the Main Camera in the Hierarchy view, then use the Add Component button
that appears in the Inspector. You'll see a Component pop-up window that has already organized
components by behavior, in this case those scripts involving camera behavior into a Camera-Control
menu selection. Click it to see the script icons and select Mouse Orbit from the list (Figure 4-3 ).
Figure 4-3. Using Add Component to attach the MouseOrbit script
If you're trying out each of these methods, remember you can remove the component through the
same gear icon you used for resetting component property values (Figure 4-4 ).
Figure 4-4. Removing a component from the gear drop-down menu in the Inspector
In Chapter 2 you learned that if you declare a variable as public, it will appear in the Inspector
view as an editable property. In Figure 4-5 you see the properties in the MouseOrbit component
compared to the public variables declared in the MouseOrbit script. You can compare for yourself by
selecting the MouseOrbit script icon in the Project panel; the script will appear in the Inspector.
 
Search WWH ::




Custom Search