Started working on turrets
This commit is contained in:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user