From be13f8e51da73a2465c7c210cfb2e0216f93afd7 Mon Sep 17 00:00:00 2001 From: NoelStephensUnity Date: Thu, 14 Aug 2025 10:37:12 -0500 Subject: [PATCH 1/4] update Adding asmdef define for 6000.3.0a6 or higher and using that within RigidbodyContactEventManager to switch from using otherBodyInstanceID to otherBodyEntityId. --- .../Runtime/Components/RigidbodyContactEventManager.cs | 4 ++++ .../Runtime/Unity.Netcode.Runtime.asmdef | 7 ++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/com.unity.netcode.gameobjects/Runtime/Components/RigidbodyContactEventManager.cs b/com.unity.netcode.gameobjects/Runtime/Components/RigidbodyContactEventManager.cs index b2dcb94efe..0040bb0096 100644 --- a/com.unity.netcode.gameobjects/Runtime/Components/RigidbodyContactEventManager.cs +++ b/com.unity.netcode.gameobjects/Runtime/Components/RigidbodyContactEventManager.cs @@ -375,7 +375,11 @@ public void Execute(int index) var result = new JobResultStruct() { ThisInstanceID = PairedHeaders[index].bodyInstanceID, +#if CONTACTPAIRHEADER_OTHERBODYENTITYID + OtherInstanceID = PairedHeaders[index].otherBodyEntityId, +#else OtherInstanceID = PairedHeaders[index].otherBodyInstanceID, +#endif AverageNormal = averageNormal, HasCollisionStay = collisionStaycount != 0, AverageCollisionStayNormal = averageCollisionStay, diff --git a/com.unity.netcode.gameobjects/Runtime/Unity.Netcode.Runtime.asmdef b/com.unity.netcode.gameobjects/Runtime/Unity.Netcode.Runtime.asmdef index e4de012706..bf240ed22f 100644 --- a/com.unity.netcode.gameobjects/Runtime/Unity.Netcode.Runtime.asmdef +++ b/com.unity.netcode.gameobjects/Runtime/Unity.Netcode.Runtime.asmdef @@ -77,7 +77,12 @@ "name": "Unity", "expression": "6000.1.0a1", "define": "HOSTNAME_RESOLUTION_AVAILABLE" - } + }, + { + "name": "Unity", + "expression": "6000.3.0a6", + "define": "CONTACTPAIRHEADER_OTHERBODYENTITYID" + }, ], "noEngineReferences": false } \ No newline at end of file From caa2f8abc62d73e575e9a98595d71522d98b97a4 Mon Sep 17 00:00:00 2001 From: NoelStephensUnity Date: Thu, 14 Aug 2025 11:20:35 -0500 Subject: [PATCH 2/4] fix Removing extra comma. --- .../Runtime/Unity.Netcode.Runtime.asmdef | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/com.unity.netcode.gameobjects/Runtime/Unity.Netcode.Runtime.asmdef b/com.unity.netcode.gameobjects/Runtime/Unity.Netcode.Runtime.asmdef index bf240ed22f..c1327967f8 100644 --- a/com.unity.netcode.gameobjects/Runtime/Unity.Netcode.Runtime.asmdef +++ b/com.unity.netcode.gameobjects/Runtime/Unity.Netcode.Runtime.asmdef @@ -82,7 +82,7 @@ "name": "Unity", "expression": "6000.3.0a6", "define": "CONTACTPAIRHEADER_OTHERBODYENTITYID" - }, + } ], "noEngineReferences": false } \ No newline at end of file From 7f429b1aae68ab47ca502e3a0a469ac6818cb036 Mon Sep 17 00:00:00 2001 From: NoelStephensUnity Date: Thu, 14 Aug 2025 11:47:06 -0500 Subject: [PATCH 3/4] update Adjusting bodyInstanceID to be bodyEntityId in 6000.0.0a36 --- .../Runtime/Components/RigidbodyContactEventManager.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/com.unity.netcode.gameobjects/Runtime/Components/RigidbodyContactEventManager.cs b/com.unity.netcode.gameobjects/Runtime/Components/RigidbodyContactEventManager.cs index 0040bb0096..fe739f0438 100644 --- a/com.unity.netcode.gameobjects/Runtime/Components/RigidbodyContactEventManager.cs +++ b/com.unity.netcode.gameobjects/Runtime/Components/RigidbodyContactEventManager.cs @@ -374,10 +374,11 @@ public void Execute(int index) var result = new JobResultStruct() { - ThisInstanceID = PairedHeaders[index].bodyInstanceID, #if CONTACTPAIRHEADER_OTHERBODYENTITYID + ThisInstanceID = PairedHeaders[index].bodyEntityId, OtherInstanceID = PairedHeaders[index].otherBodyEntityId, #else + ThisInstanceID = PairedHeaders[index].bodyInstanceID, OtherInstanceID = PairedHeaders[index].otherBodyInstanceID, #endif AverageNormal = averageNormal, From b7203280c4f597af4123ab2059c9dd98951ce902 Mon Sep 17 00:00:00 2001 From: NoelStephensUnity Date: Thu, 14 Aug 2025 12:18:49 -0500 Subject: [PATCH 4/4] update Renaming the define to something more generic in the event we need to use it for something else. --- .../Runtime/Components/RigidbodyContactEventManager.cs | 2 +- .../Runtime/Unity.Netcode.Runtime.asmdef | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/com.unity.netcode.gameobjects/Runtime/Components/RigidbodyContactEventManager.cs b/com.unity.netcode.gameobjects/Runtime/Components/RigidbodyContactEventManager.cs index fe739f0438..b455bde3d6 100644 --- a/com.unity.netcode.gameobjects/Runtime/Components/RigidbodyContactEventManager.cs +++ b/com.unity.netcode.gameobjects/Runtime/Components/RigidbodyContactEventManager.cs @@ -374,7 +374,7 @@ public void Execute(int index) var result = new JobResultStruct() { -#if CONTACTPAIRHEADER_OTHERBODYENTITYID +#if UNITY_6000_3_0A6_OR_HIGHER ThisInstanceID = PairedHeaders[index].bodyEntityId, OtherInstanceID = PairedHeaders[index].otherBodyEntityId, #else diff --git a/com.unity.netcode.gameobjects/Runtime/Unity.Netcode.Runtime.asmdef b/com.unity.netcode.gameobjects/Runtime/Unity.Netcode.Runtime.asmdef index c1327967f8..837ccc9e9f 100644 --- a/com.unity.netcode.gameobjects/Runtime/Unity.Netcode.Runtime.asmdef +++ b/com.unity.netcode.gameobjects/Runtime/Unity.Netcode.Runtime.asmdef @@ -81,7 +81,7 @@ { "name": "Unity", "expression": "6000.3.0a6", - "define": "CONTACTPAIRHEADER_OTHERBODYENTITYID" + "define": "UNITY_6000_3_0A6_OR_HIGHER" } ], "noEngineReferences": false