diff --git a/Assets/Audio/EventSound.meta b/Assets/Audio/EventSound.meta new file mode 100644 index 00000000..6c75722e --- /dev/null +++ b/Assets/Audio/EventSound.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 4681e853ca3be2d468c0f788df50ed10 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Audio/EventSound/EndGame.wav b/Assets/Audio/EventSound/EndGame.wav new file mode 100644 index 00000000..00a79ef8 Binary files /dev/null and b/Assets/Audio/EventSound/EndGame.wav differ diff --git a/Assets/Audio/EventSound/EndGame.wav.meta b/Assets/Audio/EventSound/EndGame.wav.meta new file mode 100644 index 00000000..3373d984 --- /dev/null +++ b/Assets/Audio/EventSound/EndGame.wav.meta @@ -0,0 +1,22 @@ +fileFormatVersion: 2 +guid: b50fdf426d2aea54a81f015bcf8509e8 +AudioImporter: + externalObjects: {} + serializedVersion: 6 + defaultSettings: + loadType: 0 + sampleRateSetting: 0 + sampleRateOverride: 44100 + compressionFormat: 1 + quality: 1 + conversionMode: 0 + platformSettingOverrides: {} + forceToMono: 0 + normalize: 1 + preloadAudioData: 1 + loadInBackground: 0 + ambisonic: 0 + 3D: 1 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scenes/Levels/Level3.unity b/Assets/Scenes/Levels/Level3.unity index c514c37e..a8a647b1 100644 --- a/Assets/Scenes/Levels/Level3.unity +++ b/Assets/Scenes/Levels/Level3.unity @@ -88755,6 +88755,7 @@ GameObject: - component: {fileID: 1746053424} - component: {fileID: 1746053425} - component: {fileID: 1746053426} + - component: {fileID: 1746053427} m_Layer: 0 m_Name: EndGameTrigger m_TagString: Untagged @@ -88804,6 +88805,7 @@ MonoBehaviour: textAnimation: {fileID: 1959528442} imageAnimation: {fileID: 2014965103} endGameDelay: 15 + _audioSource: {fileID: 1746053427} --- !u!54 &1746053426 Rigidbody: m_ObjectHideFlags: 0 @@ -88820,6 +88822,102 @@ Rigidbody: m_Interpolate: 0 m_Constraints: 126 m_CollisionDetection: 0 +--- !u!82 &1746053427 +AudioSource: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1746053422} + m_Enabled: 1 + serializedVersion: 4 + OutputAudioMixerGroup: {fileID: 0} + m_audioClip: {fileID: 8300000, guid: b50fdf426d2aea54a81f015bcf8509e8, type: 3} + m_PlayOnAwake: 0 + m_Volume: 1 + 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!1001 &1747563559 PrefabInstance: m_ObjectHideFlags: 0 diff --git a/Assets/Scripts/Interactables/Triggers/EndGameTrigger.cs b/Assets/Scripts/Interactables/Triggers/EndGameTrigger.cs index e2640288..08bd808c 100644 --- a/Assets/Scripts/Interactables/Triggers/EndGameTrigger.cs +++ b/Assets/Scripts/Interactables/Triggers/EndGameTrigger.cs @@ -1,5 +1,6 @@ using System.Collections; using UnityEngine; +using UnityEngine.InputSystem; public class EndGameTrigger : MonoBehaviour { @@ -7,7 +8,9 @@ public class EndGameTrigger : MonoBehaviour [SerializeField] private Animator textAnimation; [SerializeField] private Animator imageAnimation; [SerializeField] private float endGameDelay; + [SerializeField] private AudioSource _audioSource; private WaitForSeconds _endGameDelay; + private bool triggerd; private void Awake() { @@ -28,8 +31,18 @@ private IEnumerator EndGameTimer() private void EndGame() { + triggerd = true; + _audioSource.Play(); StartCoroutine("EndGameTimer"); textAnimation.SetBool("ReachedEnd", true); imageAnimation.SetBool("ReachedEnd", true); } + + private void HandleInput(InputAction.CallbackContext context) + { + if (triggerd && context.performed) + { + Application.Quit(); + } + } }