restructure script folder

This commit is contained in:
2026-03-07 14:42:14 -06:00
parent 94fa81168d
commit 1e08b70e2c
33 changed files with 40 additions and 17 deletions
@@ -0,0 +1,57 @@
using UnityEngine;
public class RoomDoor : Interactable
{
public RoomDoor linkedDoor;
public bool requiresInteraction; // Do we need to press a button to enter?
// transform that the character should walk towards when entering the room
// through this door
public Transform WalkDirection;
TeleportHandler teleportHandler;
// not required and only plays if interaction is required
public Animation doorAnimator;
public AnimationClip openDoor;
public AnimationClip closeDoor;
private void Start()
{
teleportHandler = GameObject.FindWithTag("Player").GetComponent<TeleportHandler>();
}
public override void Interact()
{
if (requiresInteraction)
{
if (doorAnimator && openDoor)
{
doorAnimator.clip = openDoor;
doorAnimator.Play();
}
teleportHandler.EnterRoom(this);
}
}
public void CloseDoor()
{
if (doorAnimator && closeDoor)
{
doorAnimator.clip = closeDoor;
doorAnimator.Play();
}
}
public override void MoveInsideRange()
{
if (!requiresInteraction)
{
teleportHandler.EnterRoom(this);
}
}
public override void MoveOutsideRange()
{
// Do nothing
}
}