2022-01-26 20:35:43 -08:00

25 lines
538 B
C#

using QSB.AuthoritySync;
using QSB.Messaging;
using QSB.OrbSync.WorldObjects;
namespace QSB.OrbSync.Messages
{
public class OrbDragMessage : QSBWorldObjectMessage<QSBOrb, bool>
{
public OrbDragMessage(bool isDragging) => Value = isDragging;
public override void OnReceiveLocal()
{
if (QSBCore.IsHost && Value)
{
WorldObject.TransformSync.netIdentity.UpdateAuthQueue(From, AuthQueueAction.Force);
}
}
public override void OnReceiveRemote()
{
OnReceiveLocal();
WorldObject.SetDragging(Value);
}
}
}