Skip to content

Commit 09f6bb2

Browse files
fix
This resolves the issue with the EntityId no longer supporting integer conversion.
1 parent 3f98489 commit 09f6bb2

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

com.unity.netcode.gameobjects/Runtime/Components/RigidbodyContactEventManager.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,10 +90,15 @@ private struct JobResultStruct
9090
private NativeArray<JobResultStruct> m_ResultsArray;
9191
private int m_Count = 0;
9292
private JobHandle m_JobHandle;
93-
93+
#if UNITY_6000_2_OR_NEWER
94+
private readonly Dictionary<EntityId, Rigidbody> m_RigidbodyMapping = new Dictionary<EntityId, Rigidbody>();
95+
private readonly Dictionary<EntityId, IContactEventHandler> m_HandlerMapping = new Dictionary<EntityId, IContactEventHandler>();
96+
private readonly Dictionary<EntityId, ContactEventHandlerInfo> m_HandlerInfo = new Dictionary<EntityId, ContactEventHandlerInfo>();
97+
#else
9498
private readonly Dictionary<int, Rigidbody> m_RigidbodyMapping = new Dictionary<int, Rigidbody>();
9599
private readonly Dictionary<int, IContactEventHandler> m_HandlerMapping = new Dictionary<int, IContactEventHandler>();
96100
private readonly Dictionary<int, ContactEventHandlerInfo> m_HandlerInfo = new Dictionary<int, ContactEventHandlerInfo>();
101+
#endif
97102

98103
private void OnEnable()
99104
{

com.unity.netcode.gameobjects/Runtime/Transports/UTP/UnityTransport.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -355,9 +355,13 @@ private struct PacketLossCache
355355
public int PacketsDropped;
356356
public float PacketLoss;
357357
};
358-
358+
#if UNITY_6000_2_OR_NEWER
359+
internal static event Action<EntityId, NetworkDriver> TransportInitialized;
360+
internal static event Action<EntityId> TransportDisposed;
361+
#else
359362
internal static event Action<int, NetworkDriver> TransportInitialized;
360363
internal static event Action<int> TransportDisposed;
364+
#endif
361365

362366
/// <summary>
363367
/// Provides access to the <see cref="NetworkDriver"/> for this instance.
@@ -435,6 +439,7 @@ private void InitDriver()
435439
out m_UnreliableSequencedFragmentedPipeline,
436440
out m_ReliableSequencedPipeline);
437441
#if UNITY_6000_2_OR_NEWER
442+
// TODO-FIXME: This is to work around the
438443
TransportInitialized?.Invoke(GetEntityId(), m_Driver);
439444
#else
440445
TransportInitialized?.Invoke(GetInstanceID(), m_Driver);

0 commit comments

Comments
 (0)