mirror of
https://github.com/misternebula/quantum-space-buddies.git
synced 2025-01-04 02:47:22 +00:00
27 lines
625 B
C#
27 lines
625 B
C#
using Mirror;
|
|
using QSB.Messaging;
|
|
using QSB.OrbSync.WorldObjects;
|
|
|
|
namespace QSB.OrbSync.Messages;
|
|
|
|
public class OrbSlotMessage : QSBWorldObjectMessage<QSBOrb, int>
|
|
{
|
|
private bool _playAudio;
|
|
|
|
public OrbSlotMessage(int slotIndex, bool playAudio) : base(slotIndex) =>
|
|
_playAudio = playAudio;
|
|
|
|
public override void Serialize(NetworkWriter writer)
|
|
{
|
|
base.Serialize(writer);
|
|
writer.Write(_playAudio);
|
|
}
|
|
|
|
public override void Deserialize(NetworkReader reader)
|
|
{
|
|
base.Deserialize(reader);
|
|
_playAudio = reader.Read<bool>();
|
|
}
|
|
|
|
public override void OnReceiveRemote() => WorldObject.SetSlot(Data, _playAudio);
|
|
} |