Action makes sound

Now, before we get into the core of the new ApplicationManager, we need to add another component to the AppManager object.

While I like the atmospheric sounds that play when the game begins, it needs something else for when the ball is thrown. Let's add that now:

  1. With AppManager selected, click on AddComponent | Audio | AudioSource.
  2. Get the skee.wav file from the downloads package and put it in your Sounds directory.
  3. Drag the skee.wav file to the AudioClip field of the AudioSource component and drop it.
  4. Then, change the Spatial Blend from 2D to 3D.

With the new audio source added to the object, we now need to get a reference to the Application Manager component. How are we going to do that? They are on the same object. Maybe the answer is just too obvious that people think it's a trick question, but really you just drag the application manager object from the Hierarchy view to the open field in the Application Manager component.

Once you do that, the appropriate class will appear in the field, as you can see in the SkeeBall Sound slot:

Oh, and ensure that there's only one slot left to fill.

In the Prefabs directory, select the GameBall Prefab and drag it to that last slot in the Application Manager (Script), called Skeeball Prefab.

Also, while we are here, delete the text in the DebugInfoString field and replace it with Air-Tap once the Spatial Mapping is complete, to continue. We will be using 3DTextPrefab for instructions in the final application.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.117.183.252