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