diff --git a/Packages/com.unity.inputsystem/CHANGELOG.md b/Packages/com.unity.inputsystem/CHANGELOG.md index 2a36143974..7d11b796b5 100644 --- a/Packages/com.unity.inputsystem/CHANGELOG.md +++ b/Packages/com.unity.inputsystem/CHANGELOG.md @@ -34,6 +34,7 @@ however, it has to be formatted properly to pass verification tests. - Fixed an issue with default device selection when adding new Control Scheme. - Fixed an issue where action map delegates were not updated when the asset already assigned to the PlayerInput component were changed [ISXB-711](https://issuetracker.unity3d.com/product/unity/issues/guid/ISXB-711). - Fixed Action properties edition in the UI Toolkit version of the Input Actions Asset editor. [ISXB-1277](https://issuetracker.unity3d.com/product/unity/issues/guid/ISXB-1277) +- Fixed an issue where batch jobs would fail with "Error: Error building Player because scripts are compiling" if a source generated .inputactions asset is out of sync with its generated source code (ISXB-1300). ### Changed - Added back the InputManager to InputSystem project-wide asset migration code with performance improvement (ISX-2086). diff --git a/Packages/com.unity.inputsystem/InputSystem/Editor/AssetImporter/InputActionImporter.cs b/Packages/com.unity.inputsystem/InputSystem/Editor/AssetImporter/InputActionImporter.cs index 6aa8af8a3a..6a625feb96 100644 --- a/Packages/com.unity.inputsystem/InputSystem/Editor/AssetImporter/InputActionImporter.cs +++ b/Packages/com.unity.inputsystem/InputSystem/Editor/AssetImporter/InputActionImporter.cs @@ -256,11 +256,11 @@ private static void GenerateWrapperCode(AssetImportContext ctx, InputActionAsset if (InputActionCodeGenerator.GenerateWrapperCode(wrapperFilePath, asset, options)) { - // When we generate the wrapper code cs file during asset import, we cannot call ImportAsset on that directly because - // script assets have to be imported before all other assets, and are not allowed to be added to the import queue during - // asset import. So instead we register a callback to trigger a delayed asset refresh which should then pick up the - // changed/added script, and trigger a new import. - EditorApplication.delayCall += AssetDatabase.Refresh; + // This isn't ideal and may have side effects, but we cannot avoid compiling again. + // Previously we attempted to run a EditorApplication.delayCall += AssetDatabase.Refresh + // but this would lead to "error: Error building Player because scripts are compiling" in CI. + // Previous comment here warned against not being able to reimport here directly, but it seems it's ok. + AssetDatabase.ImportAsset(wrapperFilePath); } }