#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
ITS488 Lecture 6: Music and Sound Effect & GVR Try out.
1. Lecture 6: Music and Sound Effect
& GVR Try out.
Dr. Kobkrit Viriyayudhakorn
iApp Technology Limited
kobkrit@iapp.co.th
ITS488 (Digital Content Creation with Unity - Game and VR Programming)
6. Import Audio Kit
1. Menu Bar > Assets > Import Package > Custom Package...
2. Select the "AudioKit.unitypackage"
3. Make sure that all files
are selected, and then
Press "Import"
8. Adding Music to the Game
1. Select "Scene 1". Right click at
Hierarchy > Audio > Audio Source
2. Drag the "music...come..."
to the Audio Source
9. Configure the Music
1. Select Audio Source
2. Checked at
• Play On Awake
• Loop
3. Run "Play" to Test.
10. Exercise 1: Add a sound to Game Over.
• Find the sound that seems most appropriate to you.
• Should it be looping or not?
• Add the audio source to the Game Over scene.
11. Adding Sound Effect to Ball
1. Open the Scene 2 > ShootHoopKit >
Drag the ball to the Hierarchy windows
2. Select the ball at the right inspector windows >
Add Component > Audio Source
3. The attached audio source
is added into the Ball Game object
12. Trigger Sound Effect by Code
1. Drag a drop Sound file. the impact_deep_thud_bounce
sound file into the AudioClip
2. Add the new C# script, "BallBounceSound.cs"
13. BallBounceSound.cs
2. Drag the BallBounceSound.cs to attached
with the ball game object. >>
1. Writing the above code.
Trigger Sound Effect by Code
14. Make the customized ball as the prefab
1. Press "Play" now, We will heard
only the single drop of sounds.
Even you firing multiple ball.
2. Drag the customized ball as
the ball prefab.
3. Press Play again.
Now you will heard multiple
drop sounds.
15. Exercise 2: Adding a scoring sound.
• Add an audio source component.
• Find a good scoring sound.
• Trigger in the appropriate place.
16. Solution for Exercise 2
• Enter the ScoreCount.cs, Add the AudioSource part at IncreaseScore Function.
17. 1. Select "ScoreCount" Game Object,
At the inspector windows, Add "Audio source".
2. Drag and drop "Chime_ball_02" at the AudioClip part.
Unchecked "Play On Awake checkbox.
24. Import GVR unity package
1. Assets > Import Package > Custom Package....
2. Select GoogleVRForUnity_1.110.0.unitypackage
3. Make sure that all items are checked
and then "Import"
26. Play around with GVR Demo
1. File > Build Settings...
1. Tap "Add Open Scenes"
2. Select iOS
3. Click "Switch Platform"
27. Change to Virtual Reality Project
1. Click on "Player Settings"
2. At the XR Settings,
Select "Virtual Reality
Supported"
and Add "Cardboard" to
Virtual Reality SDK
28. Test on iOS
1. Connect with iOS phone to the machine.
2. Press "Build and Run"
29. Fast VR project using GVR
1. Create a New Empty Scene
2. Add Cube into the Scene,
Make it in front of the Camera
3. Play
You can not move any view.
30. 1. Go to Google VR Assets > Prefabs
Using GVR Prefab
2. Import the prefab like this...
31. Now you can move in VR
• Shift + Move Mouse = Change Orientation
• Shift + Left Mouse Button = ClickButton
• Shift + Right Mouse Button = AppButton
• Shift + Middle Mouse Button = HomeButton/Recenter
• Shift + Ctrl = IsTouching
• Shift + Ctrl + Move Mouse = Change TouchPos
32. There is much more in Google VR
• A simple reticle prefab and associated scripts for gaze-based user interaction.
• User head tracking.
• Side-by-side stereo rendering.
• Detecting user interaction with the system (via trigger or controller).
• Automatic stereo configuration for a specific VR viewer.
• Distortion correction for a VR viewer's lenses.
• An alignment marker to help center the screen under the lenses when you insert your phone into
a viewer.
• Automatic gyro drift correction.