2020-12-16 09:08:38 +00:00
|
|
|
|
using QuantumUNET.Transport;
|
2020-12-15 16:37:52 +00:00
|
|
|
|
|
|
|
|
|
namespace QuantumUNET.Messages
|
2020-11-08 14:41:16 +00:00
|
|
|
|
{
|
2020-12-23 12:58:45 +00:00
|
|
|
|
internal class QAnimationMessage : QMessageBase
|
2020-12-02 21:23:01 +00:00
|
|
|
|
{
|
2021-12-03 03:41:19 +00:00
|
|
|
|
public QNetworkInstanceId netId;
|
2020-12-02 21:23:01 +00:00
|
|
|
|
public int stateHash;
|
|
|
|
|
public float normalizedTime;
|
|
|
|
|
public byte[] parameters;
|
2020-11-08 14:41:16 +00:00
|
|
|
|
|
2020-12-23 12:58:45 +00:00
|
|
|
|
public override void Serialize(QNetworkWriter writer)
|
2020-12-02 21:23:01 +00:00
|
|
|
|
{
|
|
|
|
|
writer.Write(netId);
|
|
|
|
|
writer.WritePackedUInt32((uint)stateHash);
|
|
|
|
|
writer.Write(normalizedTime);
|
2020-12-20 23:50:24 +00:00
|
|
|
|
writer.WriteBytesAndSize(parameters, parameters?.Length ?? 0);
|
2020-12-02 21:23:01 +00:00
|
|
|
|
}
|
2020-12-16 09:08:38 +00:00
|
|
|
|
|
2020-12-23 12:58:45 +00:00
|
|
|
|
public override void Deserialize(QNetworkReader reader)
|
2020-12-16 09:08:38 +00:00
|
|
|
|
{
|
|
|
|
|
netId = reader.ReadNetworkId();
|
|
|
|
|
stateHash = (int)reader.ReadPackedUInt32();
|
|
|
|
|
normalizedTime = reader.ReadSingle();
|
|
|
|
|
parameters = reader.ReadBytesAndSize();
|
|
|
|
|
}
|
2020-12-02 21:23:01 +00:00
|
|
|
|
}
|
2020-11-08 16:13:10 +00:00
|
|
|
|
}
|