Komplett Lauffähig + Vibration + Boni + Enemie "Jumpscares" - Audio
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
using TMPro;
|
||||
using Unity.VisualScripting;
|
||||
using UnityEngine;
|
||||
using static UnityEngine.EventSystems.EventTrigger;
|
||||
|
||||
@@ -8,26 +9,50 @@ public class ChangeHealth : MonoBehaviour
|
||||
|
||||
|
||||
[SerializeField] public int deathCounter;
|
||||
[SerializeField] GameObject panel;
|
||||
[SerializeField] GameObject scriptPile;
|
||||
[SerializeField] GameObject scriptPileAgain;
|
||||
[SerializeField] GameObject guessWhatAgain;
|
||||
[SerializeField] TMP_Text healthHUD;
|
||||
[SerializeField] public int standardHealth = 3;
|
||||
//[SerializeField] GameObject levelScript; //wird aktuell nicht genutzt
|
||||
|
||||
|
||||
[Header("Enemies")]
|
||||
[SerializeField] GameObject eFie;
|
||||
[SerializeField] GameObject eSilv;
|
||||
[SerializeField] GameObject eHai;
|
||||
|
||||
[Header("ScriptPile")]
|
||||
|
||||
LevelBehavior level;
|
||||
InventoryScript inventory;
|
||||
GameOver end;
|
||||
|
||||
|
||||
FieScript fie;
|
||||
SilvScript silv;
|
||||
HaiScript hai;
|
||||
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
inventory = panel.GetComponent<InventoryScript>();
|
||||
end = panel.GetComponent<GameOver>();
|
||||
inventory = scriptPileAgain.GetComponent<InventoryScript>(); //TO DO: FIXEN
|
||||
end = guessWhatAgain.GetComponent<GameOver>();
|
||||
level = scriptPile.GetComponent<LevelBehavior>();
|
||||
|
||||
fie = eFie.GetComponent<FieScript>();
|
||||
silv = eSilv.GetComponent<SilvScript>();
|
||||
hai = eHai.GetComponent<HaiScript>();
|
||||
}
|
||||
|
||||
void Start()
|
||||
{
|
||||
if (level.gameOngoing == true)
|
||||
{
|
||||
Debug.Log("ich existiere!");
|
||||
}
|
||||
|
||||
deathCounter = 0;
|
||||
inventory.Health = standardHealth;
|
||||
inventory.Health = inventory.StandardHealth;
|
||||
Debug.Log(inventory.Health);
|
||||
}
|
||||
|
||||
@@ -40,6 +65,8 @@ public class ChangeHealth : MonoBehaviour
|
||||
|
||||
public void GetHit() //MUSS NOCH MIT ENEMIES VERKNÜPFT WERDEN
|
||||
{
|
||||
|
||||
Vibrator.Vibrate();
|
||||
if (inventory.Health > 0)
|
||||
{
|
||||
inventory.Health -= 1; //MAGIC NUMBER BITTE BEACHTEN
|
||||
@@ -55,6 +82,7 @@ public class ChangeHealth : MonoBehaviour
|
||||
|
||||
public void GetHitHard() //MUSS NOCH MIT ENEMIES VERKNÜPFT WERDEN
|
||||
{
|
||||
Vibrator.Vibrate();
|
||||
if (inventory.Health > 0)
|
||||
{
|
||||
inventory.Health -= 2; //MAGIC NUMBER BITTE BEACHTEN
|
||||
@@ -76,6 +104,10 @@ public class ChangeHealth : MonoBehaviour
|
||||
//Time.timeScale = 0; //Wieder umlegen
|
||||
end.ShowDeathScreen();
|
||||
Debug.Log("rest in pizza");
|
||||
|
||||
level.gameOngoing = false;
|
||||
|
||||
end.StopEnemies();
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user