mirror of
https://github.com/misternebula/quantum-space-buddies.git
synced 2024-12-28 18:25:18 +00:00
25 lines
527 B
C#
25 lines
527 B
C#
using QSB.Messaging;
|
|
using QSB.WorldSync;
|
|
|
|
namespace QSB.ShipSync.Messages
|
|
{
|
|
internal class HatchMessage : QSBBoolMessage
|
|
{
|
|
public HatchMessage(bool open) => Value = open;
|
|
|
|
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();
|
|
}
|
|
}
|
|
}
|
|
} |