mirror of
https://github.com/misternebula/quantum-space-buddies.git
synced 2025-01-30 12:32:55 +00:00
25 lines
552 B
C#
25 lines
552 B
C#
using Mirror;
|
|
using QSB.Messaging;
|
|
using QSB.OrbSync.WorldObjects;
|
|
|
|
namespace QSB.OrbSync.Messages
|
|
{
|
|
public class OrbSlotMessage : QSBWorldObjectMessage<QSBOrb, int>
|
|
{
|
|
public OrbSlotMessage(int slotIndex) => Value = slotIndex;
|
|
|
|
public override void Serialize(NetworkWriter writer)
|
|
{
|
|
base.Serialize(writer);
|
|
writer.Write(Value);
|
|
}
|
|
|
|
public override void Deserialize(NetworkReader reader)
|
|
{
|
|
base.Deserialize(reader);
|
|
Value = reader.Read<int>();
|
|
}
|
|
|
|
public override void OnReceiveRemote() => WorldObject.SetSlot(Value);
|
|
}
|
|
} |