Skip to content

Conversation

@K-Tone
Copy link
Collaborator

@K-Tone K-Tone commented Nov 27, 2025

Description

Not much to add on top of the PR title. We've accumulated a few warnings that show up when the package is used with Unity 6.4 and 6.5. Basically, these classes of warnings:

  1. (6.4) Related to GetInstanceId() -> GetEntityId() migration, this creates a fair bit of new ifdef split based on Unity version since we need to store different data here.

  2. (6.4) Related to CreateAssetWithContent -> CreateAssetWithTextContent

  3. (6.5) Related to SearchFlags.Sorted being deprecated now - I've migrated without ifdef too, since the Unity Search developers confirmed that this flag is not taken into account for the picker window. The window has its own sorting mechanism.

Testing status & QA

No feature change hopefully, compiles locally, waiting for CI now

Overall Product Risks

  • Complexity: Low
  • Halo Effect: Low

Checklist

Before review:

  • Changelog entry added.
    • Explains the change in Changed, Fixed, Added sections.
    • For API change contains an example snippet and/or migration example.
    • JIRA ticket linked, example (case %%). If it is a private issue, just add the case ID without a link.
    • Jira port for the next release set as "Resolved".
  • Tests added/changed, if applicable.
    • Functional tests Area_CanDoX, Area_CanDoX_EvenIfYIsTheCase, Area_WhenIDoX_AndYHappens_ThisIsTheResult.
    • Performance tests.
    • Integration tests.
  • Docs for new/changed API's.
    • Xmldoc cross references are set correctly.
    • Added explanation how the API works.
    • Usage code examples added.
    • The manual is updated, if needed.

During merge:

  • Commit message for squash-merge is prefixed with one of the list:
    • NEW: ___.
    • FIX: ___.
    • DOCS: ___.
    • CHANGE: ___.
    • RELEASE: 1.1.0-preview.3.

@K-Tone K-Tone force-pushed the anthony/fix-warnings-6.4-and-6.5 branch from 13c196a to 4b1105e Compare November 27, 2025 09:54
@K-Tone K-Tone changed the title Anthony/fix warnings 6.4 and 6.5 FIX: Address compilation warnings from Unity 6.4 and 6.5 Nov 27, 2025
@K-Tone K-Tone marked this pull request as ready for review November 27, 2025 10:31
@u-pr-agent
Copy link
Contributor

u-pr-agent bot commented Nov 27, 2025

PR Reviewer Guide 🔍

Here are some key observations to aid the review process:

⏱️ Estimated effort to review: 2 🔵🔵⚪⚪⚪

The PR involves straightforward API updates for newer Unity versions using conditional compilation. The review mainly requires verifying the behavior of the new `GetEntityId()` API regarding its string representation and type conversion.
🏅 Score: 92

The code correctly implements version-specific fixes to resolve warnings. However, there is a potential risk regarding the string representation of the new Entity ID type which could affect the search provider functionality.
🧪 No relevant tests
🔒 No security concerns identified
⚡ Recommended focus areas for review

Verify GetEntityId().ToString() uniqueness

The code calls ToString() on the result of GetEntityId(). If GetEntityId() returns a custom struct (which is implied by the existence of an implicit cast to int mentioned in PlayerInputEditor.cs) and that struct does not override ToString(), it might return the type name (e.g., "UnityEngine.EntityId") instead of a unique value. This would result in duplicate IDs for search items, breaking the search provider.

itemId = asset.GetEntityId().ToString();
Potential ID truncation

The result of GetEntityId() is assigned to an int variable assetInstanceID. If GetEntityId() returns a 64-bit ID or a struct containing more data than an int, this implicit cast causes truncation. While the comment acknowledges this as a "minimum footprint" solution, verify that the integer representation remains sufficiently unique to reliably detect asset changes and avoid collisions.

assetInstanceID = m_ActionsProperty.objectReferenceValue.GetEntityId();
  • Update review

🤖 Helpful? Please react with 👍/👎 | Questions❓Please reach out in Slack #ask-u-pr-agent

@u-pr-agent
Copy link
Contributor

u-pr-agent bot commented Nov 27, 2025

PR Code Suggestions ✨

Explore these optional code suggestions:

CategorySuggestion                                                                                                                                    Impact
General
Remove redundant explicit int cast

The explicit cast to int is redundant since assetInstanceID is already of type int.
Removing it simplifies the assignment.

Packages/com.unity.inputsystem/InputSystem/Plugins/PlayerInput/PlayerInputEditor.cs [291-294]

 // 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;
+m_ActionAssetInstanceID = assetInstanceID;
 return result;
Suggestion importance[1-10]: 7

__

Why: The variable assetInstanceID is already of type int, making the explicit cast (int)assetInstanceID redundant. Removing it simplifies the code without changing behavior.

Medium
  • More suggestions

🤖 Helpful? Please react with 👍/👎 | Questions❓Please reach out in Slack #ask-u-pr-agent

@codecov-github-com
Copy link

codecov-github-com bot commented Nov 27, 2025

Codecov Report

Attention: Patch coverage is 10.00000% with 9 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
.../PropertyDrawers/InputActionAssetSearchProvider.cs 0.00% 3 Missing ⚠️
...ertyDrawers/InputActionReferenceSearchProviders.cs 25.00% 3 Missing ⚠️
...putSystem/Plugins/PlayerInput/PlayerInputEditor.cs 0.00% 2 Missing ⚠️
...System/Editor/AssetImporter/InputActionImporter.cs 0.00% 1 Missing ⚠️
@@             Coverage Diff             @@
##           develop    #2295      +/-   ##
===========================================
- Coverage    77.95%   77.95%   -0.01%     
===========================================
  Files          477      477              
  Lines        97416    97422       +6     
===========================================
  Hits         75943    75943              
- Misses       21473    21479       +6     
Flag Coverage Δ
inputsystem_MacOS_2022.3 5.54% <0.00%> (-0.01%) ⬇️
inputsystem_MacOS_2022.3_project 75.49% <16.66%> (-0.01%) ⬇️
inputsystem_MacOS_6000.0 5.32% <0.00%> (-0.01%) ⬇️
inputsystem_MacOS_6000.0_project 77.41% <16.66%> (-0.01%) ⬇️
inputsystem_MacOS_6000.2 5.32% <0.00%> (-0.01%) ⬇️
inputsystem_MacOS_6000.2_project 77.40% <16.66%> (-0.01%) ⬇️
inputsystem_MacOS_6000.3 5.32% <0.00%> (-0.01%) ⬇️
inputsystem_MacOS_6000.3_project 77.41% <16.66%> (-0.01%) ⬇️
inputsystem_MacOS_6000.4 5.33% <0.00%> (-0.01%) ⬇️
inputsystem_MacOS_6000.4_project 77.42% <14.28%> (-0.01%) ⬇️
inputsystem_MacOS_6000.5 5.33% <0.00%> (-0.01%) ⬇️
inputsystem_MacOS_6000.5_project 77.41% <14.28%> (-0.01%) ⬇️
inputsystem_Ubuntu_2022.3 5.54% <0.00%> (-0.01%) ⬇️
inputsystem_Ubuntu_2022.3_project 75.29% <16.66%> (-0.01%) ⬇️
inputsystem_Ubuntu_6000.0 5.32% <0.00%> (-0.01%) ⬇️
inputsystem_Ubuntu_6000.0_project 77.21% <16.66%> (-0.01%) ⬇️
inputsystem_Ubuntu_6000.2 5.32% <0.00%> (-0.01%) ⬇️
inputsystem_Ubuntu_6000.2_project 77.21% <16.66%> (-0.01%) ⬇️
inputsystem_Ubuntu_6000.3 5.32% <0.00%> (-0.01%) ⬇️
inputsystem_Ubuntu_6000.3_project 77.21% <16.66%> (-0.01%) ⬇️
inputsystem_Ubuntu_6000.4 5.33% <0.00%> (-0.01%) ⬇️
inputsystem_Ubuntu_6000.4_project 77.23% <14.28%> (+<0.01%) ⬆️
inputsystem_Ubuntu_6000.5 5.33% <0.00%> (-0.01%) ⬇️
inputsystem_Ubuntu_6000.5_project 77.22% <14.28%> (-0.01%) ⬇️
inputsystem_Windows_2022.3 5.54% <0.00%> (-0.01%) ⬇️
inputsystem_Windows_2022.3_project 75.62% <16.66%> (-0.01%) ⬇️
inputsystem_Windows_6000.0 5.32% <0.00%> (-0.01%) ⬇️
inputsystem_Windows_6000.0_project 77.53% <16.66%> (-0.01%) ⬇️
inputsystem_Windows_6000.2 5.32% <0.00%> (-0.01%) ⬇️
inputsystem_Windows_6000.2_project 77.53% <16.66%> (-0.01%) ⬇️
inputsystem_Windows_6000.3 5.32% <0.00%> (-0.01%) ⬇️
inputsystem_Windows_6000.3_project 77.53% <16.66%> (-0.01%) ⬇️
inputsystem_Windows_6000.4 5.33% <0.00%> (-0.01%) ⬇️
inputsystem_Windows_6000.4_project 77.54% <14.28%> (-0.01%) ⬇️
inputsystem_Windows_6000.5 5.33% <0.00%> (-0.01%) ⬇️
inputsystem_Windows_6000.5_project 77.54% <14.28%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
...System/Editor/AssetImporter/InputActionImporter.cs 57.81% <0.00%> (-0.23%) ⬇️
...putSystem/Plugins/PlayerInput/PlayerInputEditor.cs 7.75% <0.00%> (-0.02%) ⬇️
.../PropertyDrawers/InputActionAssetSearchProvider.cs 0.00% <0.00%> (ø)
...ertyDrawers/InputActionReferenceSearchProviders.cs 27.90% <25.00%> (-1.37%) ⬇️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@K-Tone K-Tone requested a review from ekcoh November 27, 2025 10:57
// 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

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

@K-Tone
Copy link
Collaborator Author

K-Tone commented Nov 27, 2025

CC @Pauliusd01 for viz that this is happening, hopefully nothing changes in regards to functionality

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants