Komplett mit Audio, Fehler beim Start der Spielszenen: standardHealth und standardEnergy werden nicht wie gewollt übermittelt
This commit is contained in:
@@ -6,9 +6,11 @@ public class DoorController : MonoBehaviour
|
||||
[SerializeField] private Door door;
|
||||
[SerializeField] GameObject energyScript;
|
||||
[SerializeField] GameObject inventoryScript;
|
||||
[SerializeField] GameObject audioScript;
|
||||
|
||||
HandleEnergy energy;
|
||||
InventoryScript inventory;
|
||||
AudioManager audio;
|
||||
|
||||
|
||||
float timer = 0f;
|
||||
@@ -18,6 +20,7 @@ public class DoorController : MonoBehaviour
|
||||
{
|
||||
energy = energyScript.GetComponent<HandleEnergy>();
|
||||
inventory = inventoryScript.GetComponent<InventoryScript>();
|
||||
audio = audioScript.GetComponent<AudioManager>();
|
||||
}
|
||||
|
||||
private void Update()
|
||||
@@ -36,6 +39,7 @@ public class DoorController : MonoBehaviour
|
||||
|
||||
if (inventory.Energy > 0)
|
||||
{
|
||||
audio.PlaySFX(audio.door);
|
||||
Vibrator.Vibrate();
|
||||
door.isOpen = false;
|
||||
Debug.Log("Hier kommt niemand rein");
|
||||
|
||||
Reference in New Issue
Block a user