diff --git a/Assets/SFX.meta b/Assets/SFX.meta new file mode 100644 index 0000000..74d0ff6 --- /dev/null +++ b/Assets/SFX.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 0325188b590ec764ea7eaa4738bfb210 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/SFX/game win.wav b/Assets/SFX/game win.wav new file mode 100644 index 0000000..a2b249b --- /dev/null +++ b/Assets/SFX/game win.wav @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:441a1213d06651680cdbdc865f8270778632f73cee15fc32dd10ed8e619a1ee6 +size 1154620 diff --git a/Assets/SFX/game win.wav.meta b/Assets/SFX/game win.wav.meta new file mode 100644 index 0000000..ee93a20 --- /dev/null +++ b/Assets/SFX/game win.wav.meta @@ -0,0 +1,22 @@ +fileFormatVersion: 2 +guid: 28e0a439b36cd2341853b72e288dcedb +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/SFX/laser charge 1.wav b/Assets/SFX/laser charge 1.wav new file mode 100644 index 0000000..5aa98ac --- /dev/null +++ b/Assets/SFX/laser charge 1.wav @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:92c2ca1761619f2d5793fe70b26954c419f8a0d701d03560d2582347e69b7959 +size 461876 diff --git a/Assets/SFX/laser charge 1.wav.meta b/Assets/SFX/laser charge 1.wav.meta new file mode 100644 index 0000000..7e0fb50 --- /dev/null +++ b/Assets/SFX/laser charge 1.wav.meta @@ -0,0 +1,22 @@ +fileFormatVersion: 2 +guid: 11846f18b7d49e641beba97013045838 +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/SFX/laser charge 2.wav b/Assets/SFX/laser charge 2.wav new file mode 100644 index 0000000..fcfa583 --- /dev/null +++ b/Assets/SFX/laser charge 2.wav @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2ef23cb5cba438857995823d67b4ef746ae90430f9e9ac1d93cb6e67adf0262d +size 461876 diff --git a/Assets/SFX/laser charge 2.wav.meta b/Assets/SFX/laser charge 2.wav.meta new file mode 100644 index 0000000..25785ee --- /dev/null +++ b/Assets/SFX/laser charge 2.wav.meta @@ -0,0 +1,22 @@ +fileFormatVersion: 2 +guid: 3245775db4b49f3449dbedaac0e4f411 +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/SFX/laser charge 3.wav b/Assets/SFX/laser charge 3.wav new file mode 100644 index 0000000..b86c1c6 --- /dev/null +++ b/Assets/SFX/laser charge 3.wav @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:97cd0a8777d2a456f6230cd42496890278ce2071ff4d555ebad84710f0b813d8 +size 461876 diff --git a/Assets/SFX/laser charge 3.wav.meta b/Assets/SFX/laser charge 3.wav.meta new file mode 100644 index 0000000..6885486 --- /dev/null +++ b/Assets/SFX/laser charge 3.wav.meta @@ -0,0 +1,22 @@ +fileFormatVersion: 2 +guid: 9e2c47348d29d6740a5b186ae7a72472 +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/SFX/laser decharge.wav b/Assets/SFX/laser decharge.wav new file mode 100644 index 0000000..dde224a --- /dev/null +++ b/Assets/SFX/laser decharge.wav @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d93d804b7b16103304553762a235148febae0bb72739555b23a22d2f7db96935 +size 461876 diff --git a/Assets/SFX/laser decharge.wav.meta b/Assets/SFX/laser decharge.wav.meta new file mode 100644 index 0000000..9b8c3f5 --- /dev/null +++ b/Assets/SFX/laser decharge.wav.meta @@ -0,0 +1,22 @@ +fileFormatVersion: 2 +guid: d0066a33cf9ef0f4ea7118123dfcf70e +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/SFX/level win.wav b/Assets/SFX/level win.wav new file mode 100644 index 0000000..0fcde06 --- /dev/null +++ b/Assets/SFX/level win.wav @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:deb0a2e4e627025b60930f81a9e40cae8e24c17addf2843958059ea1454c1055 +size 923704 diff --git a/Assets/SFX/level win.wav.meta b/Assets/SFX/level win.wav.meta new file mode 100644 index 0000000..eca72c5 --- /dev/null +++ b/Assets/SFX/level win.wav.meta @@ -0,0 +1,22 @@ +fileFormatVersion: 2 +guid: e13e0e68d44e19c4ab2e1362ed95d75d +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/Ending.unity b/Assets/Scenes/Ending.unity index a4925a8..3a323d3 100644 --- a/Assets/Scenes/Ending.unity +++ b/Assets/Scenes/Ending.unity @@ -151,6 +151,7 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: songName: intro + delay: 4000 --- !u!4 &431181848 Transform: m_ObjectHideFlags: 0 @@ -418,7 +419,7 @@ RectTransform: - {fileID: 449727263} - {fileID: 1827190587} m_Father: {fileID: 0} - m_RootOrder: 5 + m_RootOrder: 4 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 0, y: 0} @@ -1133,7 +1134,7 @@ PrefabInstance: - target: {fileID: 3147621778718822447, guid: 93a04d811a6112d4a8f0fbf322926bc8, type: 3} propertyPath: m_RootOrder - value: 8 + value: 7 objectReference: {fileID: 0} - target: {fileID: 3147621778718822447, guid: 93a04d811a6112d4a8f0fbf322926bc8, type: 3} @@ -1167,6 +1168,133 @@ PrefabInstance: objectReference: {fileID: 0} m_RemovedComponents: [] m_SourcePrefab: {fileID: 100100000, guid: 93a04d811a6112d4a8f0fbf322926bc8, type: 3} +--- !u!1 &1092080712 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1092080713} + - component: {fileID: 1092080714} + m_Layer: 0 + m_Name: SFX + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1092080713 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1092080712} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0.12765458, y: 0.0710839, z: -8.319533} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 8 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!82 &1092080714 +AudioSource: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1092080712} + m_Enabled: 1 + serializedVersion: 4 + OutputAudioMixerGroup: {fileID: 0} + m_audioClip: {fileID: 8300000, guid: 28e0a439b36cd2341853b72e288dcedb, type: 3} + m_PlayOnAwake: 1 + 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 &1501736835 PrefabInstance: m_ObjectHideFlags: 0 @@ -1300,7 +1428,7 @@ Transform: m_LocalScale: {x: 1, y: 1, z: 1} m_Children: [] m_Father: {fileID: 0} - m_RootOrder: 6 + m_RootOrder: 5 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &1598451562 GameObject: @@ -1679,133 +1807,6 @@ CanvasRenderer: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1827190586} m_CullTransparentMesh: 0 ---- !u!1 &1925040025 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 1925040027} - - component: {fileID: 1925040026} - m_Layer: 0 - m_Name: Music - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!82 &1925040026 -AudioSource: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1925040025} - m_Enabled: 1 - serializedVersion: 4 - OutputAudioMixerGroup: {fileID: 0} - m_audioClip: {fileID: 8300000, guid: 70468d0f91cbb24408f26c930e0cfc35, type: 3} - m_PlayOnAwake: 1 - m_Volume: 1 - m_Pitch: 1 - Loop: 1 - 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!4 &1925040027 -Transform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1925040025} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: -0.48254675, y: -0.23101182, z: -0.10147177} - m_LocalScale: {x: 1, y: 1, z: 1} - m_Children: [] - m_Father: {fileID: 0} - m_RootOrder: 4 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &2061767511 GameObject: m_ObjectHideFlags: 0 @@ -1885,5 +1886,5 @@ Transform: m_LocalScale: {x: 1.25, y: 1.25, z: 1} m_Children: [] m_Father: {fileID: 0} - m_RootOrder: 7 + m_RootOrder: 6 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} diff --git a/Assets/Scripts/MusicManager.cs b/Assets/Scripts/MusicManager.cs index 67802c4..d8a9768 100644 --- a/Assets/Scripts/MusicManager.cs +++ b/Assets/Scripts/MusicManager.cs @@ -27,13 +27,11 @@ public class MusicManager : MonoBehaviour public void PlaySong(string songName) { - StopOtherSongs(songName); - if (songName == "intro" && !intro.isPlaying) intro.Play(); if (songName == "gameplay" && !gameplay.isPlaying) gameplay.Play(); } - public void StopOtherSongs(string currentSongName) + public void StopOtherSongs(string currentSongName = "") { if (currentSongName != "intro") intro.Stop(); if (currentSongName != "gameplay") gameplay.Stop(); diff --git a/Assets/Scripts/MusicStarter.cs b/Assets/Scripts/MusicStarter.cs index 569485f..c309ef8 100644 --- a/Assets/Scripts/MusicStarter.cs +++ b/Assets/Scripts/MusicStarter.cs @@ -6,6 +6,9 @@ using UnityEngine; public class MusicStarter : MonoBehaviour { public string songName = "gameplay"; + public int delay = 0; + + int delayForSetup = 250; void Start() { @@ -14,9 +17,10 @@ public class MusicStarter : MonoBehaviour async void DelayedSongRequest() { - await Task.Delay(250); - GameObject.FindWithTag("MusicManager") - .GetComponent() - .PlaySong(songName); + await Task.Delay(delayForSetup); + MusicManager m = GameObject.FindWithTag("MusicManager").GetComponent(); + m.StopOtherSongs(); + await Task.Delay(delay - delayForSetup); + m.PlaySong(songName); } }