mirror of
https://github.com/misternebula/quantum-space-buddies.git
synced 2025-01-01 03:32:38 +00:00
24 lines
504 B
C#
24 lines
504 B
C#
using QSB.Messaging;
|
|
using QSB.WorldSync;
|
|
|
|
namespace QSB.ShipSync.Messages;
|
|
|
|
internal class HatchMessage : QSBMessage<bool>
|
|
{
|
|
public HatchMessage(bool open) => Value = open;
|
|
|
|
public override bool ShouldReceive => QSBWorldSync.AllObjectsReady;
|
|
|
|
public override void OnReceiveRemote()
|
|
{
|
|
if (Value)
|
|
{
|
|
ShipManager.Instance.HatchController.OpenHatch();
|
|
}
|
|
else
|
|
{
|
|
ShipManager.Instance.ShipTractorBeam.DeactivateTractorBeam();
|
|
ShipManager.Instance.HatchController.CloseHatch();
|
|
}
|
|
}
|
|
} |