mirror of
https://github.com/misternebula/quantum-space-buddies.git
synced 2025-01-01 03:32:38 +00:00
25 lines
498 B
C#
25 lines
498 B
C#
using QSB.Messaging;
|
|
using QSB.Player;
|
|
using QSB.TriggerSync.WorldObjects;
|
|
|
|
namespace QSB.TriggerSync.Messages;
|
|
|
|
public class TriggerMessage : QSBWorldObjectMessage<IQSBTrigger, bool>
|
|
{
|
|
public TriggerMessage(bool entered) => Data = entered;
|
|
|
|
public override void OnReceiveLocal() => OnReceiveRemote();
|
|
|
|
public override void OnReceiveRemote()
|
|
{
|
|
var player = QSBPlayerManager.GetPlayer(From);
|
|
if (Data)
|
|
{
|
|
WorldObject.Enter(player);
|
|
}
|
|
else
|
|
{
|
|
WorldObject.Exit(player);
|
|
}
|
|
}
|
|
} |