public void Interact() { CancelInvoke(); door.OpenByPresentAction(); Invoke("CloseDoor", openForTime); ui.ShowDoorOpenForSeconds(openForTime); }
private void OnTriggerEnter(Collider other) { Debug.Log(other.gameObject.layer); Debug.Log(playerLayer); if (other.gameObject.layer == playerLayer) { activated = true; door.OpenByPresentAction(); ui.ShowDoorOpenPermanentNotification(); } }
/*private void OnTriggerExit(Collider other) { * CloseDoor(); * }*/ public void Interact(Player player) { if (player.HasKeyCard(type)) { CancelInvoke(); door.OpenByPresentAction(); Invoke("CloseDoor", openForTime); } else { Debug.Log("You do not have the correct keycard to open this door"); } }