Game Development Reference
In-Depth Information
of settings based on the distance. Audio Filters, if available, can
also be employed by this same method, enabling more realistic
depictions of occlusion and obstruction.
READ ME!
While we recommend downloading
and trying our demo example project
from the website (www.focalpress.
com/cw/Horowitz) we understand
that readers may be confused and
bewildered by a lot of seemingly non-
audio related material. Also some
people may have some technical
limitations that preclude them from
downloading and installing new
software. Don't panic! This is all very
useful knowledge and we've done
our best to accommodate dif erent
learning methods. Here are your
available options:
1. Download a working Unity
demo: You can download Unity
and then download our simple
demo project from the Focal Press
website at www.focalpress.com/
cw/Horowitz, and follow along
in the topic with the procedures
outlined on the next page.
2. If you cannot or do not wish to
download the demo, or you need
further assistance, go to the
application and check out the Unity
walkthrough in the Holodeck area.
Triggering an Audio Source
An Audio Source can be triggered by a number of conditions, but
only a very few of them can be configured using no coding or
scripting expertise. The simplest of these is an object appearing
in the game space for the first time. The sound is tied to the
source by a sound trigger, and looping can be turned on or off
as well.
Any other type of triggering will require some scripting
knowledge and usage of other components. For example, an
object might make a sound if the player runs into it. The object will
not play the sound on its own, however; the sound requires the
trigger event, which in this case is the collision, and the direction
to play a sound comes from the script. Another example would be
a sound that occurs when you click on the mouse to i re in a i rst-
person shooter. In this case, a script is set up to look for mouse
events, so when a mouse event is detected, the script triggers the
sound to play.
Hands On With Unity
In order to give you a better idea of how audio sources can function and
be triggered inside a game environment, you really need to understand
at least a little bit about how Unity is put together. We're going to take
you step-by-step through Unity to help you re-create an extremely simple
game function. A player will walk around a simple virtual environment with
an ambient background and walk into an object, which will make a sound
of some kind. In the process you'll learn at least a little bit about how Unity
itself works and begin to understand the logic underlying its engine.
Go to the main
classroom in the App,
and click on the Videos
screen to watch the
step-by-step tutorials
covering Unity's basic
structure.
To continue, you'll need to download Unity and install it i rst. Open a web
browser and go to www.unity3d.com/downloads . This might take a bit
of time, as the installer is about 1GB in size. Go watch a movie, or have
a sandwich while it downloads. Once you've downloaded and installed
the program, go to the following website to get our free basic demo level
 
Search WWH ::




Custom Search