erster commit
This commit is contained in:
38
Assets/Scripts/Fisch/FishPoints.cs
Normal file
38
Assets/Scripts/Fisch/FishPoints.cs
Normal file
@@ -0,0 +1,38 @@
|
||||
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);
|
||||
}
|
||||
}
|
11
Assets/Scripts/Fisch/FishPoints.cs.meta
Normal file
11
Assets/Scripts/Fisch/FishPoints.cs.meta
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 757fdabe6e42aeb418f6d8f16c8bebe4
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
33
Assets/Scripts/Fisch/FishPoints2.cs
Normal file
33
Assets/Scripts/Fisch/FishPoints2.cs
Normal file
@@ -0,0 +1,33 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class FishPoints2 : MonoBehaviour
|
||||
{
|
||||
GameObject Fisch2;
|
||||
public PlayerScript playerScript;
|
||||
AudioManager audioManager;
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
audioManager = GameObject.FindGameObjectWithTag("Audio").GetComponent<AudioManager>();
|
||||
}
|
||||
private void OnTriggerEnter2D(Collider2D kaputt)
|
||||
{
|
||||
FishPoints2 Fish = kaputt.GetComponent<FishPoints2>();
|
||||
if (Fish != null)
|
||||
{
|
||||
GetCollected();
|
||||
}
|
||||
}
|
||||
public void GetCollected()
|
||||
{
|
||||
if (Fisch2 != null)
|
||||
{
|
||||
Destroy(Fisch2);
|
||||
audioManager.PlaySFX(audioManager.Fisch);
|
||||
playerScript.Fisch2Collected = true;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
11
Assets/Scripts/Fisch/FishPoints2.cs.meta
Normal file
11
Assets/Scripts/Fisch/FishPoints2.cs.meta
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 32607f3eb46158f43b70b3eceeb4bb41
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
33
Assets/Scripts/Fisch/FishPoints3.cs
Normal file
33
Assets/Scripts/Fisch/FishPoints3.cs
Normal file
@@ -0,0 +1,33 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class FishPoints3 : MonoBehaviour
|
||||
{
|
||||
GameObject Fisch3;
|
||||
PlayerScript playerScript;
|
||||
AudioManager audioManager;
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
audioManager = GameObject.FindGameObjectWithTag("Audio").GetComponent<AudioManager>();
|
||||
}
|
||||
private void OnTriggerEnter2D(Collider2D kaputt)
|
||||
{
|
||||
FishPoints3 Fish = kaputt.GetComponent<FishPoints3>();
|
||||
if (Fish != null)
|
||||
{
|
||||
GetCollected();
|
||||
}
|
||||
}
|
||||
|
||||
public void GetCollected()
|
||||
{
|
||||
if (Fisch3 != null)
|
||||
{
|
||||
Destroy(Fisch3);
|
||||
audioManager.PlaySFX(audioManager.Fisch);
|
||||
playerScript.Fisch3Collected = true;
|
||||
}
|
||||
}
|
||||
}
|
11
Assets/Scripts/Fisch/FishPoints3.cs.meta
Normal file
11
Assets/Scripts/Fisch/FishPoints3.cs.meta
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: ca83ff5b9bda9e2408d93cfb3e14314d
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
Reference in New Issue
Block a user