Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Packages/com.unity.inputsystem/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ however, it has to be formatted properly to pass verification tests.

## [Unreleased] - yyyy-mm-dd

### Fixed

- Fixed warnings being generated on Unity 6.4 and 6.5. (ISX-2395).

## [1.17.0] - 2025-11-25

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -328,8 +328,13 @@
[MenuItem("Assets/Create/Input Actions")]
public static void CreateInputAsset()
{
#if UNITY_6000_4_OR_NEWER
ProjectWindowUtil.CreateAssetWithTextContent("New Actions." + InputActionAsset.Extension,

Check warning on line 332 in Packages/com.unity.inputsystem/InputSystem/Editor/AssetImporter/InputActionImporter.cs

View check run for this annotation

Codecov GitHub.com / codecov/patch

Packages/com.unity.inputsystem/InputSystem/Editor/AssetImporter/InputActionImporter.cs#L332

Added line #L332 was not covered by tests
InputActionAsset.kDefaultAssetLayoutJson, InputActionAssetIconLoader.LoadAssetIcon());
#else
ProjectWindowUtil.CreateAssetWithContent("New Actions." + InputActionAsset.Extension,
InputActionAsset.kDefaultAssetLayoutJson, InputActionAssetIconLoader.LoadAssetIcon());
#endif
}

// File extension of the associated asset
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
using System.Collections.Generic;
using UnityEditor;
using UnityEditor.Search;
using UnityEngine.Search;

namespace UnityEngine.InputSystem.Editor
{
Expand All @@ -12,8 +11,6 @@
const string k_AssetFolderSearchProviderId = "AssetsInputActionAssetSearchProvider";
const string k_ProjectWideActionsSearchProviderId = "ProjectWideInputActionAssetSearchProvider";

const string k_ProjectWideAssetIdentificationString = " [Project Wide Input Actions]";
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This constant wasn't used anywhere


internal static SearchProvider CreateInputActionAssetSearchProvider()
{
return CreateInputActionAssetSearchProvider(k_AssetFolderSearchProviderId,
Expand Down Expand Up @@ -101,7 +98,17 @@

if (!label.Contains(context.searchText, System.StringComparison.InvariantCultureIgnoreCase))
continue; // Ignore due to filtering
yield return provider.CreateItem(context, asset.GetInstanceID().ToString(), label, createItemFetchDescription(asset),

string itemId;

// 6.4 deprecated instance ids in favour of entity ids
#if UNITY_6000_4_OR_NEWER
itemId = asset.GetEntityId().ToString();

Check warning on line 106 in Packages/com.unity.inputsystem/InputSystem/Editor/PropertyDrawers/InputActionAssetSearchProvider.cs

View check run for this annotation

Codecov GitHub.com / codecov/patch

Packages/com.unity.inputsystem/InputSystem/Editor/PropertyDrawers/InputActionAssetSearchProvider.cs#L106

Added line #L106 was not covered by tests
#else
itemId = asset.GetInstanceID().ToString();

Check warning on line 108 in Packages/com.unity.inputsystem/InputSystem/Editor/PropertyDrawers/InputActionAssetSearchProvider.cs

View check run for this annotation

Codecov GitHub.com / codecov/patch

Packages/com.unity.inputsystem/InputSystem/Editor/PropertyDrawers/InputActionAssetSearchProvider.cs#L108

Added line #L108 was not covered by tests
#endif

yield return provider.CreateItem(context, itemId, label, createItemFetchDescription(asset),

Check warning on line 111 in Packages/com.unity.inputsystem/InputSystem/Editor/PropertyDrawers/InputActionAssetSearchProvider.cs

View check run for this annotation

Codecov GitHub.com / codecov/patch

Packages/com.unity.inputsystem/InputSystem/Editor/PropertyDrawers/InputActionAssetSearchProvider.cs#L111

Added line #L111 was not covered by tests
thumbnail, asset);
}
}
Expand All @@ -110,7 +117,6 @@
// consistent between CreateItem and additional fetchLabel calls.
private static string FetchLabel(Object obj)
{
// if (obj == InputSystem.actions) return $"{obj.name}{k_ProjectWideAssetIdentificationString}";
return obj.name;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// SearchFlags: these flags are used to customize how search is performed and how search
// results are displayed in the advanced object picker.
// Note: SearchFlags.Packages is not currently used and hides all results from packages.
internal static readonly SearchFlags PickerSearchFlags = SearchFlags.Sorted | SearchFlags.OpenPicker;
internal static readonly SearchFlags PickerSearchFlags = SearchFlags.OpenPicker;
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SearchFlags.Sorted is not relevant for picker, confirmed with Sebastien Grenier over Slack


// Search.SearchViewFlags : these flags are used to customize the appearance of the PickerWindow.
internal static readonly Search.SearchViewFlags PickerViewFlags = SearchViewFlags.DisableBuilderModeToggle
Expand Down Expand Up @@ -84,7 +84,17 @@
var label = fetchObjectLabel(asset);
if (!label.Contains(context.searchText, System.StringComparison.InvariantCultureIgnoreCase))
continue; // Ignore due to filtering
yield return provider.CreateItem(context, asset.GetInstanceID().ToString(), label, createItemFetchDescription(asset),

string itemId;

// 6.4 deprecated instance ids in favour of entity ids
#if UNITY_6000_4_OR_NEWER
itemId = asset.GetEntityId().ToString();

Check warning on line 92 in Packages/com.unity.inputsystem/InputSystem/Editor/PropertyDrawers/InputActionReferenceSearchProviders.cs

View check run for this annotation

Codecov GitHub.com / codecov/patch

Packages/com.unity.inputsystem/InputSystem/Editor/PropertyDrawers/InputActionReferenceSearchProviders.cs#L92

Added line #L92 was not covered by tests
#else
itemId = asset.GetInstanceID().ToString();

Check warning on line 94 in Packages/com.unity.inputsystem/InputSystem/Editor/PropertyDrawers/InputActionReferenceSearchProviders.cs

View check run for this annotation

Codecov GitHub.com / codecov/patch

Packages/com.unity.inputsystem/InputSystem/Editor/PropertyDrawers/InputActionReferenceSearchProviders.cs#L94

Added line #L94 was not covered by tests
#endif

yield return provider.CreateItem(context, itemId, label, createItemFetchDescription(asset),

Check warning on line 97 in Packages/com.unity.inputsystem/InputSystem/Editor/PropertyDrawers/InputActionReferenceSearchProviders.cs

View check run for this annotation

Codecov GitHub.com / codecov/patch

Packages/com.unity.inputsystem/InputSystem/Editor/PropertyDrawers/InputActionReferenceSearchProviders.cs#L97

Added line #L97 was not covered by tests
null, asset);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,16 @@
{
if (m_ActionsProperty.objectReferenceValue != null)
{
var assetInstanceID = m_ActionsProperty.objectReferenceValue.GetInstanceID();
// 6.4 deprecates instance id in favour of entity ids (a class)
// Fortunately, there is an implicit cast from entity id to an integer so we can have minimum footprint for now.
int assetInstanceID;

#if UNITY_6000_4_OR_NEWER
assetInstanceID = m_ActionsProperty.objectReferenceValue.GetEntityId();

Check warning on line 286 in Packages/com.unity.inputsystem/InputSystem/Plugins/PlayerInput/PlayerInputEditor.cs

View check run for this annotation

Codecov GitHub.com / codecov/patch

Packages/com.unity.inputsystem/InputSystem/Plugins/PlayerInput/PlayerInputEditor.cs#L286

Added line #L286 was not covered by tests
#else
assetInstanceID = m_ActionsProperty.objectReferenceValue.GetInstanceID();

Check warning on line 288 in Packages/com.unity.inputsystem/InputSystem/Plugins/PlayerInput/PlayerInputEditor.cs

View check run for this annotation

Codecov GitHub.com / codecov/patch

Packages/com.unity.inputsystem/InputSystem/Plugins/PlayerInput/PlayerInputEditor.cs#L288

Added line #L288 was not covered by tests
#endif

// if the m_ActionAssetInstanceID is 0 the PlayerInputEditor has not been initialized yet, but the asset did not change
bool result = assetInstanceID != m_ActionAssetInstanceID && m_ActionAssetInstanceID != 0;
m_ActionAssetInstanceID = (int)assetInstanceID;
Expand Down