quantum-space-buddies/QSB/ElevatorSync/ElevatorPatches.cs

17 lines
540 B
C#
Raw Normal View History

2020-08-12 19:58:29 +00:00
using OWML.ModHelper.Events;
using QSB.Events;
namespace QSB.ElevatorSync
{
public static class ElevatorPatches
{
public static void StartLift(Elevator __instance)
{
var isGoingUp = __instance.GetValue<bool>("_goingToTheEnd");
var direction = isGoingUp ? ElevatorDirection.Up : ElevatorDirection.Down;
2020-08-13 18:43:47 +00:00
var id = ElevatorManager.Instance.GetId(__instance);
GlobalMessenger<int, ElevatorDirection>.FireEvent(EventNames.QSBStartLift, id, direction);
2020-08-12 19:58:29 +00:00
}
}
}