LethalCompany/Lethal Company/ExportedProject/Assets/Scripts/Assembly-CSharp/ServerAudio.cs
2023-12-22 18:30:10 -05:00

20 lines
540 B
C#

using Unity.Netcode;
public struct ServerAudio : INetworkSerializable
{
public NetworkObjectReference audioObj;
public bool oneshot;
public bool looped;
public void NetworkSerialize<T>(BufferSerializer<T> serializer) where T : IReaderWriter
{
serializer.SerializeValue(ref audioObj, default(FastBufferWriter.ForNetworkSerializable));
serializer.SerializeValue(ref oneshot, default(FastBufferWriter.ForPrimitives));
if (!oneshot)
{
serializer.SerializeValue(ref looped, default(FastBufferWriter.ForPrimitives));
}
}
}