Started working on turrets

This commit is contained in:
2026-01-13 17:33:30 +00:00
parent 44ef19d058
commit 6f31012cd8
93 changed files with 72145 additions and 7 deletions

View File

@@ -57,25 +57,39 @@ public class Door : MonoBehaviour, IInteractable
public void Interact(GameObject interactor)
{
if (autoDoor)
if (!autoDoor)
{
if (!locked)
door.transform.Translate(0f,-3f,0f);
if (!locked && !isOpen)
{
OpenDoor(openHeight);
isOpen = true;
}
else if (!locked && isOpen)
{
CloseDoor(openHeight);
isOpen = false;
}
else if (locked)
{
Debug.Log("The door is locked.");
}
}
else
{
Debug.Log("You need to use a key to open this door.");
return;
}
}
public bool CanInteract(GameObject interactor)
{
return !locked;
return !locked;
}
public string GetInteractionPrompt()
{
return locked ? "Door is locked" : "Open door";
if (locked)
return "Door is locked";
return isOpen ? "Press [E] to close door" : "Press [E] to open door";
}
public void OnHighlight()