24 lines
441 B
C#
24 lines
441 B
C#
using UnityEngine;
|
|
|
|
public class DoorController : MonoBehaviour
|
|
{
|
|
[SerializeField] private Door door;
|
|
|
|
private void OnMouseDown()
|
|
{
|
|
if (door.isOpen == true)
|
|
{
|
|
door.isOpen = false;
|
|
Debug.Log("Hier kommt niemand rein");
|
|
}
|
|
else
|
|
{
|
|
door.isOpen = true;
|
|
Debug.Log("Es zieht uUunheimlich");
|
|
}
|
|
|
|
//door.isOpen = !door.isOpen;
|
|
|
|
}
|
|
}
|