using Mirror; using QSB.Messaging; using QSB.OrbSync.WorldObjects; namespace QSB.OrbSync.Messages; public class OrbSlotMessage : QSBWorldObjectMessage { 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(); } public override void OnReceiveRemote() => WorldObject.SetSlot(Data, _playAudio); }