quantum-space-buddies/QuantumUNET/Messages/QAnimationMessage.cs
2021-12-02 19:41:19 -08:00

28 lines
707 B
C#

using QuantumUNET.Transport;
namespace QuantumUNET.Messages
{
internal class QAnimationMessage : QMessageBase
{
public QNetworkInstanceId netId;
public int stateHash;
public float normalizedTime;
public byte[] parameters;
public override void Serialize(QNetworkWriter writer)
{
writer.Write(netId);
writer.WritePackedUInt32((uint)stateHash);
writer.Write(normalizedTime);
writer.WriteBytesAndSize(parameters, parameters?.Length ?? 0);
}
public override void Deserialize(QNetworkReader reader)
{
netId = reader.ReadNetworkId();
stateHash = (int)reader.ReadPackedUInt32();
normalizedTime = reader.ReadSingle();
parameters = reader.ReadBytesAndSize();
}
}
}