mirror of
https://github.com/misternebula/quantum-space-buddies.git
synced 2025-01-06 01:00:16 +00:00
29 lines
736 B
C#
29 lines
736 B
C#
using QuantumUNET.Transport;
|
|
using UnityEngine.Networking;
|
|
|
|
namespace QuantumUNET.Messages
|
|
{
|
|
internal class QAnimationMessage : QMessageBase
|
|
{
|
|
public NetworkInstanceId 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();
|
|
}
|
|
}
|
|
} |