From 2b0daa4e960a59ac97440eaba25c64ea9caac72e Mon Sep 17 00:00:00 2001 From: DominikB Date: Sat, 24 Jun 2023 15:13:52 +0200 Subject: [PATCH] Backup --- .../Prefabs/FadingPlatform 1.prefab | 97 +++++++++++++++++++ Assets/AssetsFORELLE/Script/FadingPlatform.cs | 4 + 2 files changed, 101 insertions(+) diff --git a/Assets/AssetsFORELLE/Prefabs/FadingPlatform 1.prefab b/Assets/AssetsFORELLE/Prefabs/FadingPlatform 1.prefab index e608ebc..65a8b83 100644 --- a/Assets/AssetsFORELLE/Prefabs/FadingPlatform 1.prefab +++ b/Assets/AssetsFORELLE/Prefabs/FadingPlatform 1.prefab @@ -86,6 +86,102 @@ GameObject: m_CorrespondingSourceObject: {fileID: 6570034849947570412, guid: 525621658d61b09439b07a6c216a3d3a, type: 3} m_PrefabInstance: {fileID: 2648003974069831317} m_PrefabAsset: {fileID: 0} +--- !u!82 &9036746185316875154 +AudioSource: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 9192667587837597305} + m_Enabled: 1 + serializedVersion: 4 + OutputAudioMixerGroup: {fileID: 0} + m_audioClip: {fileID: 0} + 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!114 &64254787590043949 MonoBehaviour: m_ObjectHideFlags: 0 @@ -100,3 +196,4 @@ MonoBehaviour: m_EditorClassIdentifier: fadeTime: 2 refractoryTime: 1.5 + fadeSound: {fileID: 8300000, guid: 312118c44c1f6cb4885313d03cb7dd02, type: 3} diff --git a/Assets/AssetsFORELLE/Script/FadingPlatform.cs b/Assets/AssetsFORELLE/Script/FadingPlatform.cs index 2b1cb77..fe6b07d 100644 --- a/Assets/AssetsFORELLE/Script/FadingPlatform.cs +++ b/Assets/AssetsFORELLE/Script/FadingPlatform.cs @@ -11,6 +11,8 @@ private EdgeCollider2D edge; public float fadeTime; public float refractoryTime; private bool gone; +private AudioSource audioSource; // Reference to the AudioSource component +public AudioClip fadeSound; // The sound clip to be played void Start() @@ -19,6 +21,7 @@ private bool gone; col = GetComponent(); edge = GetComponent(); gone = false; + audioSource = GetComponent(); } void Update() @@ -51,6 +54,7 @@ private bool gone; col.enabled = false; edge.enabled = false; gone = true; + audioSource.PlayOneShot(fadeSound); } }