This repository has been archived on 2024-08-16. You can view files and clone it, but cannot push or open issues or pull requests.
sota/RunningLateGame/Assets/Scripts/LiftDoorController.cs

31 lines
720 B
C#

/*
* authors: ryan lin
* date: 11/8/2024
* description: the lift door controller
*/
using UnityEngine;
/// <summary>
/// the lift door controller
/// </summary>
public class LiftDoorController : CommonInteractable
{
/// <summary>
/// the door that is being controlled
/// </summary>
[SerializeField] private Door door;
/// <summary>
/// the lift controller that is being referenced
/// </summary>
[SerializeField] private LiftController liftController;
/// <summary>
/// to call the open door function
/// </summary>
public override void Interact()
{
if (!door.opening && !liftController.moving) StartCoroutine(door.OpenDoor());
}
}