LethalCompany/Lethal Company/ExportedProject/Assets/Scripts/Assembly-CSharp/ServerAudio.cs

21 lines
540 B
C#
Raw Normal View History

2023-12-22 22:51:17 +00:00
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));
}
}
}