diff --git a/Assets/AssetsFORELLE/Script/ButtonDOne.cs b/Assets/AssetsFORELLE/Script/ButtonDOne.cs index 01bc0a5..02614d1 100644 --- a/Assets/AssetsFORELLE/Script/ButtonDOne.cs +++ b/Assets/AssetsFORELLE/Script/ButtonDOne.cs @@ -14,11 +14,14 @@ public bool einsAn = false; public GameObject _LevelManager1; private keyWhenPressed script1; bool isActivated; +private AudioSource audioSource; // Reference to the AudioSource component +public AudioClip pressedSound; // The sound clip to be played // Start is called before the first frame update void Start() { originalPointPosition = movingPoint.transform.position; + audioSource = GetComponent(); } // Update is called once per frame @@ -36,6 +39,9 @@ void OnTriggerEnter2D(Collider2D other) { if (other.CompareTag("PressurePlatable") || other.CompareTag("PlayerIsOnIt")){ spriteRenderer.sprite = activatedSprite; movingPoint.transform.position = activatedPointPosition; + + audioSource.PlayOneShot(pressedSound); + einsAn = true; } } diff --git a/Assets/AssetsFORELLE/Script/ButtonDThree.cs b/Assets/AssetsFORELLE/Script/ButtonDThree.cs index d7ce75e..4a0b94d 100644 --- a/Assets/AssetsFORELLE/Script/ButtonDThree.cs +++ b/Assets/AssetsFORELLE/Script/ButtonDThree.cs @@ -11,10 +11,12 @@ public Sprite activatedSprite; public bool startActivated = false; private Collider2D Stein = null; public bool dreiAn = false; +private AudioSource audioSource; // Reference to the AudioSource component +public AudioClip pressedSound; // The sound clip to be played // Start is called before the first frame update void Start() { - + audioSource = GetComponent(); } // Update is called once per frame @@ -37,6 +39,9 @@ void OnTriggerEnter2D(Collider2D other) { if (other.CompareTag("PressurePlatable")||other.CompareTag("Player")) { startActivated = true; spriteRenderer.sprite = activatedSprite; + if(!dreiAn){ + audioSource.PlayOneShot(pressedSound); + } dreiAn = true; } diff --git a/Assets/AssetsFORELLE/Script/ButtonDTwo.cs b/Assets/AssetsFORELLE/Script/ButtonDTwo.cs index f8902d1..c45ff54 100644 --- a/Assets/AssetsFORELLE/Script/ButtonDTwo.cs +++ b/Assets/AssetsFORELLE/Script/ButtonDTwo.cs @@ -11,10 +11,12 @@ public Sprite activatedSprite; public bool startActivated = false; private Collider2D Stein = null; public bool zweiAn = false; +private AudioSource audioSource; // Reference to the AudioSource component +public AudioClip pressedSound; // The sound clip to be played // Start is called before the first frame update void Start() { - + audioSource = GetComponent(); } // Update is called once per frame @@ -37,6 +39,9 @@ void OnTriggerEnter2D(Collider2D other) { if (other.CompareTag("PressurePlatable")||other.CompareTag("Player")) { startActivated = true; spriteRenderer.sprite = activatedSprite; + if(!zweiAn){ + audioSource.PlayOneShot(pressedSound); + } zweiAn = true; } diff --git a/Assets/AssetsFORELLE/Script/keyWhenPressed.cs b/Assets/AssetsFORELLE/Script/keyWhenPressed.cs index 4878504..6a3c892 100644 --- a/Assets/AssetsFORELLE/Script/keyWhenPressed.cs +++ b/Assets/AssetsFORELLE/Script/keyWhenPressed.cs @@ -11,6 +11,8 @@ public class keyWhenPressed : MonoBehaviour private ButtonDTwo script2; public GameObject _LevelManager3; private ButtonDThree script3; + private AudioSource audioSource; // Reference to the AudioSource component + public AudioClip keyAppearSound; // The sound clip to be played public bool isActivated; @@ -18,6 +20,7 @@ public class keyWhenPressed : MonoBehaviour { // Disable the object by default objectToActivate.SetActive(false); + audioSource = GetComponent(); } @@ -33,6 +36,7 @@ public class keyWhenPressed : MonoBehaviour if (eins && zwei && drei && !isActivated) { // Activate the object + audioSource.PlayOneShot(keyAppearSound); objectToActivate.SetActive(true); isActivated = true; } diff --git a/Assets/Scenes/ScenesInGame/5.0TutorialDimShift.unity.meta b/Assets/Scenes/ScenesInGame/5.0TutorialDimShift.unity.meta deleted file mode 100644 index 519d1b2..0000000 --- a/Assets/Scenes/ScenesInGame/5.0TutorialDimShift.unity.meta +++ /dev/null @@ -1,7 +0,0 @@ -fileFormatVersion: 2 -guid: 3512dddf54c8f2d4c8406d418d09c0b9 -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: