]> git.lizzy.rs Git - SuperMouseAdventure.git/blob - 2DGame/Assets/Scripts/Audio/LandingSound.cs
Improved Audio and improved dust effect
[SuperMouseAdventure.git] / 2DGame / Assets / Scripts / Audio / LandingSound.cs
1 using System.Collections;
2 using System.Collections.Generic;
3 using UnityEngine;
4
5 public class LandingSound : MonoBehaviour
6 {
7     [SerializeField]
8     GameObject groundCheck;
9
10     [SerializeField]
11     GameObject dustEffect;
12
13     private void OnCollisionEnter2D(Collision2D collision)
14     {
15         if(collision.gameObject.CompareTag("Player"))
16         {
17             FindObjectOfType<AudioManager>().Play("landung");
18             Vector3 spawnPos = new Vector3(groundCheck.transform.position.x, groundCheck.transform.position.y + 1, groundCheck.transform.position.z);
19             Instantiate(dustEffect, spawnPos, Quaternion.identity);
20         }
21     }
22 }