Seascape/Assets/Scripts/Fisch/FishPoints.cs

39 lines
834 B
C#

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<AudioManager>();
}
private void OnTriggerEnter2D(Collider2D kaputt)
{
//FishPoints Fish = kaputt.GetComponent<FishPoints>();
//if (Fish != null)
//{
// Debug.Log("AAAAAAAAAAAAAAAAA");
// GetCollected();
//}
//else
//{
// Debug.Log("Was für ein Shit");
//}
}
public void GetCollected()
{
Destroy(Fisch1);
audioManager.PlaySFX(audioManager.Fisch);
}
}