33using System . Collections . Generic ;
44using UnityEditor ;
55using UnityEditor . Search ;
6- using UnityEngine . Search ;
76
87namespace UnityEngine . InputSystem . Editor
98{
@@ -12,8 +11,6 @@ internal static class InputActionAssetSearchProviders
1211 const string k_AssetFolderSearchProviderId = "AssetsInputActionAssetSearchProvider" ;
1312 const string k_ProjectWideActionsSearchProviderId = "ProjectWideInputActionAssetSearchProvider" ;
1413
15- const string k_ProjectWideAssetIdentificationString = " [Project Wide Input Actions]" ;
16-
1714 internal static SearchProvider CreateInputActionAssetSearchProvider ( )
1815 {
1916 return CreateInputActionAssetSearchProvider ( k_AssetFolderSearchProviderId ,
@@ -101,7 +98,17 @@ private static IEnumerable<SearchItem> FilteredSearch(SearchContext context, Sea
10198
10299 if ( ! label . Contains ( context . searchText , System . StringComparison . InvariantCultureIgnoreCase ) )
103100 continue ; // Ignore due to filtering
104- yield return provider . CreateItem ( context , asset . GetInstanceID ( ) . ToString ( ) , label , createItemFetchDescription ( asset ) ,
101+
102+ string itemId ;
103+
104+ // 6.4 deprecated instance ids in favour of entity ids
105+ #if UNITY_6000_4_OR_NEWER
106+ itemId = asset . GetEntityId ( ) . ToString ( ) ;
107+ #else
108+ itemId = asset . GetInstanceID ( ) . ToString ( ) ;
109+ #endif
110+
111+ yield return provider . CreateItem ( context , itemId , label , createItemFetchDescription ( asset ) ,
105112 thumbnail , asset ) ;
106113 }
107114 }
@@ -110,7 +117,6 @@ private static IEnumerable<SearchItem> FilteredSearch(SearchContext context, Sea
110117 // consistent between CreateItem and additional fetchLabel calls.
111118 private static string FetchLabel ( Object obj )
112119 {
113- // if (obj == InputSystem.actions) return $"{obj.name}{k_ProjectWideAssetIdentificationString}";
114120 return obj . name ;
115121 }
116122
0 commit comments