From cdfcc7cecf8334696b852864b1966a490a10b282 Mon Sep 17 00:00:00 2001 From: hatayama Date: Mon, 13 Jul 2026 11:46:57 +0900 Subject: [PATCH] fix: replace obsolete GetInstanceID in RaycastGridAnnotator on Unity 6000.4+ Object.GetInstanceID() is obsolete-as-error (CS0619) starting Unity 6000.4, so the package failed to compile on Unity 6000.4+ git installs. The #1118 fix guarded ComponentPropertySerializer and HierarchyService but missed this call site. Apply the same UNITY_6000_4_OR_NEWER guard; the lower 32 bits of EntityId equal the legacy instance id, which keeps the cluster key semantics unchanged. Fixes #1732 --- Packages/src/Editor/Utils/RaycastGridAnnotator.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Packages/src/Editor/Utils/RaycastGridAnnotator.cs b/Packages/src/Editor/Utils/RaycastGridAnnotator.cs index 8a2065957..2df690c24 100644 --- a/Packages/src/Editor/Utils/RaycastGridAnnotator.cs +++ b/Packages/src/Editor/Utils/RaycastGridAnnotator.cs @@ -373,7 +373,12 @@ internal static int CreateClusterKey(Collider collider) Debug.Assert(collider != null, "Collider is required for raycast clustering."); // A placement area can use several colliders on one object; one annotation should describe the clickable object. +#if UNITY_6000_4_OR_NEWER + // GetInstanceID is obsolete-as-error on Unity 6000.4+; the lower 32 bits of EntityId equal the legacy instance id. + return (int)EntityId.ToULong(collider!.gameObject.GetEntityId()); +#else return collider!.gameObject.GetInstanceID(); +#endif } private static RaycastClusterSample CreateClusterSample(