mirror of
https://github.com/misternebula/quantum-space-buddies.git
synced 2025-01-04 02:47:22 +00:00
27 lines
518 B
C#
27 lines
518 B
C#
using QSB.Messaging;
|
|
using QSB.Player;
|
|
using QSB.TriggerSync.WorldObjects;
|
|
|
|
namespace QSB.TriggerSync.Messages
|
|
{
|
|
public class TriggerMessage : QSBBoolWorldObjectMessage<IQSBTrigger>
|
|
{
|
|
public TriggerMessage(bool entered) => Value = entered;
|
|
|
|
public override void OnReceiveLocal() => OnReceiveRemote();
|
|
|
|
public override void OnReceiveRemote()
|
|
{
|
|
var player = QSBPlayerManager.GetPlayer(From);
|
|
if (Value)
|
|
{
|
|
WorldObject.Enter(player);
|
|
}
|
|
else
|
|
{
|
|
WorldObject.Exit(player);
|
|
}
|
|
}
|
|
}
|
|
}
|