@@ -3592,7 +3592,7 @@ internal static void InitializeInEditor(IInputRuntime runtime = null)
35923592 }
35933593
35943594 Debug . Assert ( settings != null ) ;
3595- Debug . Assert ( MiscHelpers . HasNativeObject ( settings ) , "InputSettings has lost its native object" ) ;
3595+ Debug . Assert ( HasNativeObject ( settings ) , "InputSettings has lost its native object" ) ;
35963596
35973597 // If native backends for new input system aren't enabled, ask user whether we should
35983598 // enable them (requires restart). We only ask once per session and don't ask when
@@ -3695,6 +3695,16 @@ internal static void OnPlayModeChange(PlayModeStateChange change)
36953695 }
36963696 }
36973697
3698+ // We have this function to hide away instanceId -> entityId migration that happened in Unity 6.4
3699+ public static bool HasNativeObject ( Object obj )
3700+ {
3701+ #if UNITY_6000_4_OR_NEWER
3702+ return EditorUtility . EntityIdToObject ( obj . GetEntityId ( ) ) != null ;
3703+ #else
3704+ return EditorUtility . InstanceIDToObject ( obj . GetInstanceID ( ) ) != null ;
3705+ #endif
3706+ }
3707+
36983708 private static void OnProjectChange ( )
36993709 {
37003710 ////TODO: use dirty count to find whether settings have actually changed
@@ -3706,7 +3716,7 @@ private static void OnProjectChange()
37063716 // temporary settings object.
37073717 // NOTE: We access m_Settings directly here to make sure we're not running into asserts
37083718 // from the settings getter checking it has a valid object.
3709- if ( MiscHelpers . HasNativeObject ( s_Manager . m_Settings ) )
3719+ if ( HasNativeObject ( s_Manager . m_Settings ) )
37103720 {
37113721 var newSettings = ScriptableObject . CreateInstance < InputSettings > ( ) ;
37123722 newSettings . hideFlags = HideFlags . HideAndDontSave ;
0 commit comments