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/LiftButtonInteractable.cs

33 lines
809 B
C#

/*
* authors: mark joshwel, ryan lin
* date: 10/8/2024
* description: lift button behaviour implementation
*/
using UnityEngine;
/// <summary>
/// lift button behaviour implementation
/// </summary>
public class LiftButtonInteractable : CommonInteractable
{
/// <summary>
/// the number of floors the lift will move
/// </summary>
public int floorsMoved;
/// <summary>
/// the lift the button is controlling
/// </summary>
[SerializeField] private LiftController liftController;
[SerializeField] private Door door;
/// <summary>
/// a function to interact with the lift
/// </summary>
public override void Interact()
{
if (!liftController.moving && !door.isOpen) StartCoroutine(liftController.Move(floorsMoved));
}
}