Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • DownloadDownload
  • PrintPrint
Share this Page URL
Help

Exercise 2 Adding Dialogue to the Game > Implementing Dialogue

Implementing Dialogue

Now that you’ve exported your clips from Pro Tools, you’re ready to implement them in Unity.

To prepare the Unity project, follow these steps:

1. Launch the Unity application and choose FILE > OPEN PROJECT to open the PTGA_Exercises Unity project.

2. Select the Exercise_01 scene in the Project window.

3. Duplicate the scene by choosing EDIT > DUPLICATE or pressing COMMAND+D (Mac) or CTRL+D (Windows). A new scene named Exercise_01 will appear in the Project window.

4. Rename the scene Exercise_02 and add your initials to the name of the duplicated level by clicking on the Exercise_01 file to rename it. Press Return to apply the new name.

5. Double-click the duplicated level to make it active.

To import the audio files, follow these steps:

1. Navigate to the folder where you exported your dialogue clips.

2. Drag the folder to the top of the Unity Project window. The folder and all of its contents will automatically be imported into the project.

To assign the clips in the Inspector, follow these steps:

1. Click the AUDIO_MANAGER item in the Hierarchy window.

2. Assign the sounds to specific triggers in the Inspector window by clicking on the small black circle to the right of a trigger item. Triggers with no assigned sounds read None (Audio Clip). Sounds should be assigned as follows:

images Intro_Dialog: DIA_HQ_01

images Intro_Hero_Dialog: DIA_Player_01

images Player_Pain_Small: DIA_Player_02

images Player_Pain_Big: DIA_Player_03

images Player_Death: DIA_Player_04

images Enemy_Hit_01: DIA_Enemy_02

images Enemy_Hit_02: DIA_Enemy_03

images Enemy_Die: DIA_Enemy_04

images Enemy_Turret_Dialog: DIA_Turret_01

images Alarm_Loop: DIA_Security_01

Note: The last player line, DIA_Player_05, will be used in Lesson 8, “Working with Cinematics.”

To test the dialogue, follow these steps:

1. Select EDIT > PLAY or press COMMAND+P (Mac) or CTRL+P (Windows) to launch the game.

2. Using the A, S, D, and W KEYS (or arrow keys) and the mouse, navigate your character through the level, and listen for your dialogue cues.

3. Press COMMAND+P (Mac) or CTRL+P (Windows) to exit the game.