quantum-space-buddies/QSB/ShipSync/Messages/HatchMessage.cs
2023-07-28 19:30:57 +01:00

24 lines
501 B
C#

using QSB.Messaging;
using QSB.WorldSync;
namespace QSB.ShipSync.Messages;
public class HatchMessage : QSBMessage<bool>
{
public HatchMessage(bool open) : base(open) { }
public override bool ShouldReceive => QSBWorldSync.AllObjectsReady;
public override void OnReceiveRemote()
{
if (Data)
{
ShipManager.Instance.HatchController.OpenHatch();
}
else
{
ShipManager.Instance.ShipTractorBeam.DeactivateTractorBeam();
ShipManager.Instance.HatchController.CloseHatch();
}
}
}