Skip to content

Commit

Permalink
added game over sound to the game (#117)
Browse files Browse the repository at this point in the history
  • Loading branch information
MagMC authored Jan 20, 2023
1 parent 038b61c commit e6bb37a
Show file tree
Hide file tree
Showing 2 changed files with 108 additions and 0 deletions.
98 changes: 98 additions & 0 deletions Assets/Scenes/GameOverMenu.unity
Original file line number Diff line number Diff line change
Expand Up @@ -526,6 +526,7 @@ GameObject:
- component: {fileID: 1315989128}
- component: {fileID: 1315989127}
- component: {fileID: 1315989131}
- component: {fileID: 1315989132}
m_Layer: 5
m_Name: Canvas
m_TagString: Untagged
Expand Down Expand Up @@ -630,6 +631,103 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: fe9a15dc2c9034cc290b0ee8c86ca90a, type: 3}
m_Name:
m_EditorClassIdentifier:
audioSource: {fileID: 1315989132}
--- !u!82 &1315989132
AudioSource:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1315989126}
m_Enabled: 1
serializedVersion: 4
OutputAudioMixerGroup: {fileID: 24300002, guid: 04f2492515a1448d8aa0ef8c9493ee14, type: 2}
m_audioClip: {fileID: 8300000, guid: e199519c965bbdd41a8ac5a866082bc9, type: 3}
m_PlayOnAwake: 1
m_Volume: 0.6
m_Pitch: 1
Loop: 0
Mute: 0
Spatialize: 0
SpatializePostEffects: 0
Priority: 128
DopplerLevel: 1
MinDistance: 1
MaxDistance: 500
Pan2D: 0
rolloffMode: 0
BypassEffects: 0
BypassListenerEffects: 0
BypassReverbZones: 0
rolloffCustomCurve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: 1
inSlope: 0
outSlope: 0
tangentMode: 0
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
- serializedVersion: 3
time: 1
value: 0
inSlope: 0
outSlope: 0
tangentMode: 0
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
panLevelCustomCurve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: 0
inSlope: 0
outSlope: 0
tangentMode: 0
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
spreadCustomCurve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: 0
inSlope: 0
outSlope: 0
tangentMode: 0
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
reverbZoneMixCustomCurve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: 1
inSlope: 0
outSlope: 0
tangentMode: 0
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
--- !u!1 &1318077178
GameObject:
m_ObjectHideFlags: 0
Expand Down
10 changes: 10 additions & 0 deletions Assets/Scenes/Scripts/GameOver.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,16 @@

public class GameOver : MonoBehaviour
{
public AudioSource audioSource;


private void Start()
{
audioSource = GetComponent<AudioSource>();
audioSource.volume = 0.6f;
audioSource.Play();
}

public void RestartGame()
{
SceneManager.LoadScene("SampleScene");
Expand Down

0 comments on commit e6bb37a

Please sign in to comment.