using System.Collections; using System.Collections.Generic; using UnityEngine; public class FishPoints : MonoBehaviour { public GameObject Fisch1; public PlayerScript playerScript; AudioManager audioManager; private void Awake() { audioManager = GameObject.FindGameObjectWithTag("Audio").GetComponent(); } private void OnTriggerEnter2D(Collider2D kaputt) { //FishPoints Fish = kaputt.GetComponent(); //if (Fish != null) //{ // Debug.Log("AAAAAAAAAAAAAAAAA"); // GetCollected(); //} //else //{ // Debug.Log("Was für ein Shit"); //} } public void GetCollected() { Destroy(Fisch1); audioManager.PlaySFX(audioManager.Fisch); } }