fgm24/Assets/Scripts/Rope/RopeState.cs

28 lines
625 B
C#

using Unity.Netcode;
using UnityEngine;
[System.Serializable]
public struct RopeState : INetworkSerializable
{
public int tick;
public NetworkRope nrope;
public Vector3[] playerPositions;
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);
}
}