This commit is contained in:
2025-12-02 18:48:32 +08:00
parent 92ba80b399
commit bf1ca60b3b
2357 changed files with 262694 additions and 7 deletions

View File

@@ -0,0 +1,33 @@
using System;
namespace Mirror
{
// backing field for sync NetworkBehaviour
public struct NetworkBehaviourSyncVar : IEquatable<NetworkBehaviourSyncVar>
{
public uint netId;
// limited to 255 behaviours per identity
public byte componentIndex;
public NetworkBehaviourSyncVar(uint netId, int componentIndex) : this()
{
this.netId = netId;
this.componentIndex = (byte)componentIndex;
}
public bool Equals(NetworkBehaviourSyncVar other)
{
return other.netId == netId && other.componentIndex == componentIndex;
}
public bool Equals(uint netId, int componentIndex)
{
return this.netId == netId && this.componentIndex == componentIndex;
}
public override string ToString()
{
return $"[netId:{netId} compIndex:{componentIndex}]";
}
}
}