diff --git a/Assets/HDRI/sunbox.mat b/Assets/HDRI/sunbox.mat index ebce144c..0e40cf31 100644 --- a/Assets/HDRI/sunbox.mat +++ b/Assets/HDRI/sunbox.mat @@ -148,7 +148,7 @@ Material: - _Color: {r: 1, g: 1, b: 1, a: 1} - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} - _SpecColor: {r: 0.19999996, g: 0.19999996, b: 0.19999996, a: 1} - - _Tint: {r: 0.5, g: 0.5, b: 0.5, a: 0.5} + - _Tint: {r: 0.5, g: 0.5, b: 0.5, a: 0.5019608} m_BuildTextureStacks: [] m_AllowLocking: 1 --- !u!114 &6700993000498316758 diff --git a/Assets/Scenes/graybox.unity b/Assets/Scenes/graybox.unity index 3214c480..94ef1e17 100644 --- a/Assets/Scenes/graybox.unity +++ b/Assets/Scenes/graybox.unity @@ -23,9 +23,9 @@ RenderSettings: m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1} m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1} m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1} - m_AmbientIntensity: 1 + m_AmbientIntensity: 0 m_AmbientMode: 0 - m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1} + m_SubtractiveShadowColor: {r: 0.6037736, g: 0.54817134, b: 0.38447848, a: 1} m_SkyboxMaterial: {fileID: 2100000, guid: a98d893d2427f92e0abd0522a55caeb8, type: 2} m_HaloStrength: 0.5 m_FlareStrength: 1 @@ -1917,6 +1917,10 @@ PrefabInstance: propertyPath: m_LocalEulerAnglesHint.z value: 0 objectReference: {fileID: 0} + - target: {fileID: 3126527460547383063, guid: ddfc1292959bce64f8c5c758157712f1, type: 3} + propertyPath: soundClip + value: + objectReference: {fileID: 8300000, guid: 9f94811b4623455459b632554467e869, type: 3} - target: {fileID: 4208926559941835536, guid: ddfc1292959bce64f8c5c758157712f1, type: 3} propertyPath: m_Name value: Ceiling Light Bright (2) @@ -1976,7 +1980,7 @@ MonoBehaviour: m_EditorClassIdentifier: m_Version: 3 m_UsePipelineSettings: 1 - m_AdditionalLightsShadowResolutionTier: -1 + m_AdditionalLightsShadowResolutionTier: 0 m_LightLayerMask: 1 m_RenderingLayers: 1 m_CustomShadowLayers: 0 @@ -2434,6 +2438,10 @@ PrefabInstance: propertyPath: m_LocalEulerAnglesHint.z value: 0 objectReference: {fileID: 0} + - target: {fileID: 3126527460547383063, guid: ddfc1292959bce64f8c5c758157712f1, type: 3} + propertyPath: soundClip + value: + objectReference: {fileID: 8300000, guid: 9f94811b4623455459b632554467e869, type: 3} - target: {fileID: 4208926559941835536, guid: ddfc1292959bce64f8c5c758157712f1, type: 3} propertyPath: m_Name value: Ceiling Light Bright (3) @@ -2493,7 +2501,7 @@ MonoBehaviour: m_EditorClassIdentifier: m_Version: 3 m_UsePipelineSettings: 1 - m_AdditionalLightsShadowResolutionTier: -1 + m_AdditionalLightsShadowResolutionTier: 0 m_LightLayerMask: 1 m_RenderingLayers: 1 m_CustomShadowLayers: 0 @@ -2800,6 +2808,10 @@ PrefabInstance: propertyPath: m_LocalEulerAnglesHint.z value: 0 objectReference: {fileID: 0} + - target: {fileID: 3126527460547383063, guid: ddfc1292959bce64f8c5c758157712f1, type: 3} + propertyPath: soundClip + value: + objectReference: {fileID: 8300000, guid: 9f94811b4623455459b632554467e869, type: 3} - target: {fileID: 4208926559941835536, guid: ddfc1292959bce64f8c5c758157712f1, type: 3} propertyPath: m_Name value: Ceiling Light Bright (13) @@ -11732,6 +11744,10 @@ PrefabInstance: propertyPath: m_LocalEulerAnglesHint.z value: 0 objectReference: {fileID: 0} + - target: {fileID: 3126527460547383063, guid: ddfc1292959bce64f8c5c758157712f1, type: 3} + propertyPath: soundClip + value: + objectReference: {fileID: 8300000, guid: 9f94811b4623455459b632554467e869, type: 3} - target: {fileID: 4208926559941835536, guid: ddfc1292959bce64f8c5c758157712f1, type: 3} propertyPath: m_Name value: Ceiling Light Bright (7) @@ -11779,7 +11795,7 @@ MonoBehaviour: m_EditorClassIdentifier: m_Version: 3 m_UsePipelineSettings: 1 - m_AdditionalLightsShadowResolutionTier: -1 + m_AdditionalLightsShadowResolutionTier: 0 m_LightLayerMask: 1 m_RenderingLayers: 1 m_CustomShadowLayers: 0 @@ -12754,7 +12770,7 @@ MonoBehaviour: m_EditorClassIdentifier: m_Version: 3 m_UsePipelineSettings: 1 - m_AdditionalLightsShadowResolutionTier: -1 + m_AdditionalLightsShadowResolutionTier: 0 m_LightLayerMask: 1 m_RenderingLayers: 1 m_CustomShadowLayers: 0 @@ -13455,7 +13471,7 @@ RectTransform: m_LocalEulerAnglesHint: {x: 0, y: 180, z: 0} m_AnchorMin: {x: 0.5, y: 0.5} m_AnchorMax: {x: 0.5, y: 0.5} - m_AnchoredPosition: {x: -6.073, y: 2.093} + m_AnchoredPosition: {x: -6.073, y: 2.989} m_SizeDelta: {x: 20, y: 5} m_Pivot: {x: 0.5, y: 0.5} --- !u!1001 &557772168 @@ -15616,7 +15632,7 @@ MonoBehaviour: m_EditorClassIdentifier: m_Version: 3 m_UsePipelineSettings: 1 - m_AdditionalLightsShadowResolutionTier: -1 + m_AdditionalLightsShadowResolutionTier: 0 m_LightLayerMask: 1 m_RenderingLayers: 1 m_CustomShadowLayers: 0 @@ -18048,6 +18064,14 @@ PrefabInstance: propertyPath: m_IsActive value: 1 objectReference: {fileID: 0} + - target: {fileID: 1991729364740713292, guid: 4ab19bfbeb9048a45a44b9ce3847f750, type: 3} + propertyPath: m_CastShadows + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 1991729364740713292, guid: 4ab19bfbeb9048a45a44b9ce3847f750, type: 3} + propertyPath: m_StaticShadowCaster + value: 0 + objectReference: {fileID: 0} - target: {fileID: 2457027327201954434, guid: 4ab19bfbeb9048a45a44b9ce3847f750, type: 3} propertyPath: m_IsActive value: 1 @@ -18100,6 +18124,10 @@ PrefabInstance: propertyPath: m_LocalEulerAnglesHint.z value: 0 objectReference: {fileID: 0} + - target: {fileID: 5484170796833851192, guid: 4ab19bfbeb9048a45a44b9ce3847f750, type: 3} + propertyPath: m_StaticEditorFlags + value: 127 + objectReference: {fileID: 0} m_RemovedComponents: [] m_RemovedGameObjects: [] m_AddedGameObjects: [] @@ -23699,6 +23727,10 @@ PrefabInstance: propertyPath: m_LocalEulerAnglesHint.z value: 0 objectReference: {fileID: 0} + - target: {fileID: 3126527460547383063, guid: ddfc1292959bce64f8c5c758157712f1, type: 3} + propertyPath: soundClip + value: + objectReference: {fileID: 8300000, guid: 9f94811b4623455459b632554467e869, type: 3} - target: {fileID: 4208926559941835536, guid: ddfc1292959bce64f8c5c758157712f1, type: 3} propertyPath: m_Name value: Ceiling Light Bright (10) @@ -23746,7 +23778,7 @@ MonoBehaviour: m_EditorClassIdentifier: m_Version: 3 m_UsePipelineSettings: 1 - m_AdditionalLightsShadowResolutionTier: -1 + m_AdditionalLightsShadowResolutionTier: 0 m_LightLayerMask: 1 m_RenderingLayers: 1 m_CustomShadowLayers: 0 @@ -24223,6 +24255,10 @@ PrefabInstance: propertyPath: m_LocalEulerAnglesHint.z value: 0 objectReference: {fileID: 0} + - target: {fileID: 3126527460547383063, guid: ddfc1292959bce64f8c5c758157712f1, type: 3} + propertyPath: soundClip + value: + objectReference: {fileID: 8300000, guid: 9f94811b4623455459b632554467e869, type: 3} - target: {fileID: 4208926559941835536, guid: ddfc1292959bce64f8c5c758157712f1, type: 3} propertyPath: m_Name value: Ceiling Light Bright (16) @@ -24532,6 +24568,10 @@ PrefabInstance: propertyPath: m_LocalEulerAnglesHint.z value: 0 objectReference: {fileID: 0} + - target: {fileID: 3126527460547383063, guid: ddfc1292959bce64f8c5c758157712f1, type: 3} + propertyPath: soundClip + value: + objectReference: {fileID: 8300000, guid: 9f94811b4623455459b632554467e869, type: 3} - target: {fileID: 4208926559941835536, guid: ddfc1292959bce64f8c5c758157712f1, type: 3} propertyPath: m_Name value: Ceiling Light Bright (8) @@ -24579,7 +24619,7 @@ MonoBehaviour: m_EditorClassIdentifier: m_Version: 3 m_UsePipelineSettings: 1 - m_AdditionalLightsShadowResolutionTier: -1 + m_AdditionalLightsShadowResolutionTier: 0 m_LightLayerMask: 1 m_RenderingLayers: 1 m_CustomShadowLayers: 0 @@ -25947,6 +25987,10 @@ PrefabInstance: propertyPath: m_LocalEulerAnglesHint.z value: 0 objectReference: {fileID: 0} + - target: {fileID: 3126527460547383063, guid: ddfc1292959bce64f8c5c758157712f1, type: 3} + propertyPath: soundClip + value: + objectReference: {fileID: 8300000, guid: 9f94811b4623455459b632554467e869, type: 3} - target: {fileID: 4208926559941835536, guid: ddfc1292959bce64f8c5c758157712f1, type: 3} propertyPath: m_Name value: Ceiling Light Bright (1) @@ -25994,7 +26038,7 @@ MonoBehaviour: m_EditorClassIdentifier: m_Version: 3 m_UsePipelineSettings: 1 - m_AdditionalLightsShadowResolutionTier: -1 + m_AdditionalLightsShadowResolutionTier: 0 m_LightLayerMask: 1 m_RenderingLayers: 1 m_CustomShadowLayers: 0 @@ -27222,6 +27266,10 @@ PrefabInstance: propertyPath: m_LocalEulerAnglesHint.z value: 0 objectReference: {fileID: 0} + - target: {fileID: 3126527460547383063, guid: ddfc1292959bce64f8c5c758157712f1, type: 3} + propertyPath: soundClip + value: + objectReference: {fileID: 8300000, guid: 9f94811b4623455459b632554467e869, type: 3} - target: {fileID: 3485773276523611762, guid: ddfc1292959bce64f8c5c758157712f1, type: 3} propertyPath: m_IsActive value: 1 @@ -27277,7 +27325,7 @@ MonoBehaviour: m_EditorClassIdentifier: m_Version: 3 m_UsePipelineSettings: 1 - m_AdditionalLightsShadowResolutionTier: -1 + m_AdditionalLightsShadowResolutionTier: 0 m_LightLayerMask: 1 m_RenderingLayers: 1 m_CustomShadowLayers: 0 @@ -28227,6 +28275,10 @@ PrefabInstance: propertyPath: m_LocalEulerAnglesHint.z value: 0 objectReference: {fileID: 0} + - target: {fileID: 3126527460547383063, guid: ddfc1292959bce64f8c5c758157712f1, type: 3} + propertyPath: soundClip + value: + objectReference: {fileID: 8300000, guid: 9f94811b4623455459b632554467e869, type: 3} - target: {fileID: 4208926559941835536, guid: ddfc1292959bce64f8c5c758157712f1, type: 3} propertyPath: m_Name value: Ceiling Light Bright (12) @@ -29820,6 +29872,10 @@ PrefabInstance: propertyPath: m_LocalEulerAnglesHint.z value: 0 objectReference: {fileID: 0} + - target: {fileID: 3126527460547383063, guid: ddfc1292959bce64f8c5c758157712f1, type: 3} + propertyPath: soundClip + value: + objectReference: {fileID: 8300000, guid: 9f94811b4623455459b632554467e869, type: 3} - target: {fileID: 4208926559941835536, guid: ddfc1292959bce64f8c5c758157712f1, type: 3} propertyPath: m_Name value: Ceiling Light Bright (6) @@ -29867,7 +29923,7 @@ MonoBehaviour: m_EditorClassIdentifier: m_Version: 3 m_UsePipelineSettings: 1 - m_AdditionalLightsShadowResolutionTier: -1 + m_AdditionalLightsShadowResolutionTier: 0 m_LightLayerMask: 1 m_RenderingLayers: 1 m_CustomShadowLayers: 0 @@ -30749,6 +30805,10 @@ PrefabInstance: propertyPath: m_LocalEulerAnglesHint.z value: 0 objectReference: {fileID: 0} + - target: {fileID: 3126527460547383063, guid: ddfc1292959bce64f8c5c758157712f1, type: 3} + propertyPath: soundClip + value: + objectReference: {fileID: 8300000, guid: 9f94811b4623455459b632554467e869, type: 3} - target: {fileID: 4208926559941835536, guid: ddfc1292959bce64f8c5c758157712f1, type: 3} propertyPath: m_Name value: Ceiling Light Bright (5) @@ -30808,7 +30868,7 @@ MonoBehaviour: m_EditorClassIdentifier: m_Version: 3 m_UsePipelineSettings: 1 - m_AdditionalLightsShadowResolutionTier: -1 + m_AdditionalLightsShadowResolutionTier: 0 m_LightLayerMask: 1 m_RenderingLayers: 1 m_CustomShadowLayers: 0 @@ -30932,6 +30992,10 @@ PrefabInstance: propertyPath: m_LocalEulerAnglesHint.z value: 0 objectReference: {fileID: 0} + - target: {fileID: 3126527460547383063, guid: ddfc1292959bce64f8c5c758157712f1, type: 3} + propertyPath: soundClip + value: + objectReference: {fileID: 8300000, guid: 9f94811b4623455459b632554467e869, type: 3} - target: {fileID: 4208926559941835536, guid: ddfc1292959bce64f8c5c758157712f1, type: 3} propertyPath: m_Name value: Ceiling Light Bright (14) @@ -32152,7 +32216,7 @@ MonoBehaviour: m_EditorClassIdentifier: m_Version: 3 m_UsePipelineSettings: 1 - m_AdditionalLightsShadowResolutionTier: -1 + m_AdditionalLightsShadowResolutionTier: 0 m_LightLayerMask: 1 m_RenderingLayers: 1 m_CustomShadowLayers: 0 @@ -33095,6 +33159,10 @@ PrefabInstance: propertyPath: m_LocalEulerAnglesHint.z value: 0 objectReference: {fileID: 0} + - target: {fileID: 3126527460547383063, guid: ddfc1292959bce64f8c5c758157712f1, type: 3} + propertyPath: soundClip + value: + objectReference: {fileID: 8300000, guid: 9f94811b4623455459b632554467e869, type: 3} - target: {fileID: 4208926559941835536, guid: ddfc1292959bce64f8c5c758157712f1, type: 3} propertyPath: m_Name value: Ceiling Light Bright (9) @@ -33142,7 +33210,7 @@ MonoBehaviour: m_EditorClassIdentifier: m_Version: 3 m_UsePipelineSettings: 1 - m_AdditionalLightsShadowResolutionTier: -1 + m_AdditionalLightsShadowResolutionTier: 0 m_LightLayerMask: 1 m_RenderingLayers: 1 m_CustomShadowLayers: 0 @@ -33540,6 +33608,10 @@ PrefabInstance: propertyPath: m_LocalEulerAnglesHint.z value: 0 objectReference: {fileID: 0} + - target: {fileID: 3126527460547383063, guid: ddfc1292959bce64f8c5c758157712f1, type: 3} + propertyPath: soundClip + value: + objectReference: {fileID: 8300000, guid: 9f94811b4623455459b632554467e869, type: 3} - target: {fileID: 4208926559941835536, guid: ddfc1292959bce64f8c5c758157712f1, type: 3} propertyPath: m_Name value: Ceiling Light Bright (15) @@ -36895,6 +36967,10 @@ PrefabInstance: propertyPath: m_LocalEulerAnglesHint.z value: 0 objectReference: {fileID: 0} + - target: {fileID: 3126527460547383063, guid: ddfc1292959bce64f8c5c758157712f1, type: 3} + propertyPath: soundClip + value: + objectReference: {fileID: 8300000, guid: 9f94811b4623455459b632554467e869, type: 3} - target: {fileID: 4208926559941835536, guid: ddfc1292959bce64f8c5c758157712f1, type: 3} propertyPath: m_Name value: Ceiling Light Bright (4) @@ -36954,7 +37030,7 @@ MonoBehaviour: m_EditorClassIdentifier: m_Version: 3 m_UsePipelineSettings: 1 - m_AdditionalLightsShadowResolutionTier: -1 + m_AdditionalLightsShadowResolutionTier: 0 m_LightLayerMask: 1 m_RenderingLayers: 1 m_CustomShadowLayers: 0 @@ -37836,15 +37912,15 @@ PrefabInstance: m_Modifications: - target: {fileID: 7420932954599747970, guid: b2baa11c7e87fe941afe32f3c50cc082, type: 3} propertyPath: m_LocalPosition.x - value: -5.936 + value: -7.53 objectReference: {fileID: 0} - target: {fileID: 7420932954599747970, guid: b2baa11c7e87fe941afe32f3c50cc082, type: 3} propertyPath: m_LocalPosition.y - value: 3.259 + value: 3.48 objectReference: {fileID: 0} - target: {fileID: 7420932954599747970, guid: b2baa11c7e87fe941afe32f3c50cc082, type: 3} propertyPath: m_LocalPosition.z - value: -7.384 + value: -7.38 objectReference: {fileID: 0} - target: {fileID: 7420932954599747970, guid: b2baa11c7e87fe941afe32f3c50cc082, type: 3} propertyPath: m_LocalRotation.w @@ -43514,7 +43590,7 @@ MonoBehaviour: m_EditorClassIdentifier: m_Version: 3 m_UsePipelineSettings: 1 - m_AdditionalLightsShadowResolutionTier: -1 + m_AdditionalLightsShadowResolutionTier: 0 m_LightLayerMask: 1 m_RenderingLayers: 1 m_CustomShadowLayers: 0 @@ -47144,6 +47220,10 @@ PrefabInstance: propertyPath: m_LocalEulerAnglesHint.z value: 0 objectReference: {fileID: 0} + - target: {fileID: 3126527460547383063, guid: ddfc1292959bce64f8c5c758157712f1, type: 3} + propertyPath: soundClip + value: + objectReference: {fileID: 8300000, guid: 9f94811b4623455459b632554467e869, type: 3} - target: {fileID: 4208926559941835536, guid: ddfc1292959bce64f8c5c758157712f1, type: 3} propertyPath: m_Name value: Ceiling Light Bright @@ -47203,7 +47283,7 @@ MonoBehaviour: m_EditorClassIdentifier: m_Version: 3 m_UsePipelineSettings: 1 - m_AdditionalLightsShadowResolutionTier: -1 + m_AdditionalLightsShadowResolutionTier: 0 m_LightLayerMask: 1 m_RenderingLayers: 1 m_CustomShadowLayers: 0 @@ -48346,7 +48426,7 @@ MonoBehaviour: m_EditorClassIdentifier: m_Version: 3 m_UsePipelineSettings: 1 - m_AdditionalLightsShadowResolutionTier: -1 + m_AdditionalLightsShadowResolutionTier: 0 m_LightLayerMask: 1 m_RenderingLayers: 1 m_CustomShadowLayers: 0 diff --git a/Assets/ScifiOfficeLite/Meshes/Materials/Walls/Wall Set 2 Glass.mat b/Assets/ScifiOfficeLite/Meshes/Materials/Walls/Wall Set 2 Glass.mat index 12dc9e0f..c452b59f 100644 --- a/Assets/ScifiOfficeLite/Meshes/Materials/Walls/Wall Set 2 Glass.mat +++ b/Assets/ScifiOfficeLite/Meshes/Materials/Walls/Wall Set 2 Glass.mat @@ -327,9 +327,9 @@ Material: - _ZTestTransparent: 4 - _ZWrite: 0 m_Colors: - - _BaseColor: {r: 1, g: 1, b: 1, a: 0.2} + - _BaseColor: {r: 1, g: 1, b: 1, a: 0.6313726} - _BaseColorMap_MipInfo: {r: 0, g: 0, b: 0, a: 0} - - _Color: {r: 1, g: 1, b: 1, a: 0.2} + - _Color: {r: 1, g: 1, b: 1, a: 0.6313726} - _DiffusionProfileAsset: {r: 0, g: 0, b: 0, a: 0} - _DoubleSidedConstants: {r: 1, g: 1, b: -1, a: 0} - _EmissionColor: {r: 1, g: 1, b: 1, a: 1} diff --git a/Assets/Scripts/CeilingLightController.cs b/Assets/Scripts/CeilingLightController.cs index 4ab25be2..7c8fdab0 100644 --- a/Assets/Scripts/CeilingLightController.cs +++ b/Assets/Scripts/CeilingLightController.cs @@ -9,6 +9,8 @@ public class CeilingLightController : MonoBehaviour private Color defaultColor; private float defaultIntensity; public float fadeDuration = 0.5f; + [SerializeField] public AudioClip soundClip; + private AudioSource loopingSound; void Start() { @@ -18,6 +20,12 @@ public class CeilingLightController : MonoBehaviour ceilingLight.color = Color.red; ceilingLight.intensity = 0; fadeCoroutine = StartCoroutine(FadeInOut()); + + // Start looping sound + if (SoundFXManager.instance != null && soundClip != null) + { + loopingSound = SoundFXManager.instance.PlayLoopingSound(soundClip, transform, 0.01f); + } } IEnumerator FadeInOut() @@ -57,5 +65,12 @@ public class CeilingLightController : MonoBehaviour isFading = false; ceilingLight.color = defaultColor; ceilingLight.intensity = defaultIntensity; + + // Stop looping sound + if (SoundFXManager.instance != null && loopingSound != null) + { + SoundFXManager.instance.StopLoopingSound(loopingSound); + loopingSound = null; + } } } diff --git a/Assets/Sounds/Clips/alert_sound.mp3 b/Assets/Sounds/Clips/alert_sound.mp3 new file mode 100644 index 00000000..9af79f38 Binary files /dev/null and b/Assets/Sounds/Clips/alert_sound.mp3 differ diff --git a/Assets/Sounds/Clips/alert_sound.mp3.meta b/Assets/Sounds/Clips/alert_sound.mp3.meta new file mode 100644 index 00000000..c6f414ec --- /dev/null +++ b/Assets/Sounds/Clips/alert_sound.mp3.meta @@ -0,0 +1,23 @@ +fileFormatVersion: 2 +guid: 9f94811b4623455459b632554467e869 +AudioImporter: + externalObjects: {} + serializedVersion: 8 + defaultSettings: + serializedVersion: 2 + loadType: 0 + sampleRateSetting: 0 + sampleRateOverride: 44100 + compressionFormat: 1 + quality: 1 + conversionMode: 0 + preloadAudioData: 0 + platformSettingOverrides: {} + forceToMono: 0 + normalize: 1 + loadInBackground: 0 + ambisonic: 0 + 3D: 1 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Sounds/Scripts/SoundFXManager.cs b/Assets/Sounds/Scripts/SoundFXManager.cs index 082d5a12..d7cc54d4 100644 --- a/Assets/Sounds/Scripts/SoundFXManager.cs +++ b/Assets/Sounds/Scripts/SoundFXManager.cs @@ -37,4 +37,25 @@ public class SoundFXManager : MonoBehaviour Destroy(audioSource.gameObject, clipLength); } + + public AudioSource PlayLoopingSound(AudioClip clip, Transform spawnPosition, float volume) + { + // Instantiate and configure audio source + AudioSource audioSource = Instantiate(soundFXObject, spawnPosition.position, Quaternion.identity); + audioSource.clip = clip; + audioSource.volume = volume; + audioSource.loop = true; // Enable looping + audioSource.Play(); + + return audioSource; + } + + public void StopLoopingSound(AudioSource audioSource) + { + if (audioSource != null) + { + audioSource.Stop(); + Destroy(audioSource.gameObject); + } + } }