fgm24/Assets/Scripts/Rope/RopeState.cs

27 lines
587 B
C#

using Unity.Netcode;
using UnityEngine;
[System.Serializable]
public struct RopeState : INetworkSerializable
{
public int tick;
public NetworkRope nrope;
public override int GetHashCode()
{
return tick;
}
public override bool Equals(object obj)
{
GameState other = (GameState) obj;
return this.GetHashCode() == obj.GetHashCode();
}
public void NetworkSerialize<T>(BufferSerializer<T> serializer) where T : IReaderWriter
{
serializer.SerializeValue(ref tick);
nrope.NetworkSerialize(serializer);
}
}