Project 2 – Practice 2 – Unity code
In this project, the most important technical problem that needed to be solved first was to make the sound effects appear randomly. Our game was made in Unity, so I needed to edit the sound-related code in Unity. As the central part of this game has yet to be coded, I have tested the code in a previous game project, and the code is working.
First, I need to create a script for all audio, and then I will see the created sound elements in another window and then can link the audio files.



So how do make these sounds trigger in the right places? Find the corresponding directives in the other scripts and link the sound elements that should trigger at this time underneath those directives. For example, add the code for the instance sound under the link or collision action directive.



Next are three test clips.
The melodies by the sound effects in the three recorded videos are different. The code is working.