Game Development Reference
In-Depth Information
Next is the function Awake section. It uses the handy GameObject.Find
functionality. The code statements are defining the two variables we've
declared earlier, and doing so by going out and finding the GameObjects
whose names match DataPanel_Biography and DataPanel_Mission,
respectively.
Step 41: Save and return to Unity.
Step 42: Select any of the buttons and notice that the public variables are
gone. But note that when the game is played, everything still works.
Application.LoadLevel
The last button, the Begin button makes use of the Application.LoadLevel
function. This allows us to move from one Unity scene to another. However, if
the Begin button is clicked now a warning will pop up in the console that says
“Level 'Scene-EntryWay' (-1) couldn't be loaded because it has not been added
to the build settings.” We haven't talked much of builds, and we will much
more later, but it will be important to cover a bit of it here.
Build Settings
Builds are actually what Unity outputs. People play the builds that Unity
produces. Part of Unity's strength is the ability to author once and then output
builds for multiple platforms. Incursion is undoubtedly too heavy for mobile
devices, although with a bit of poly paring down and the appropriate licenses
it could ultimately be published to Android or iOS.
The Build Settings are where the target platform is defined, and the levels
to be included are indicated. To access the Build Settings go to File>Build
Settings ( Figure 12.6 ).
Figure 12.6 Build settings.
Search WWH ::




Custom Search