Skip to content

Commit 07c502d

Browse files
authored
FIX: PWA asset isn't properly restored after deleting Library folder (ISXB-853) (#1904)
* Load and assign PWA asset after asset library has finished rebuilding
1 parent 30225fa commit 07c502d

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

Packages/com.unity.inputsystem/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ however, it has to be formatted properly to pass verification tests.
1616
- NullReferenceException thrown when right-clicking an empty Action Map list in Input Actions Editor windows [ISXB-833](https://issuetracker.unity3d.com/product/unity/issues/guid/ISXB-833).
1717
- Fixed an issue where `System.ObjectDisposedException` would be thrown when deleting the last ActionMap item in the Input Actions Asset editor.
1818
- Fixed DualSense Edge's vibration and light bar not working on Windows
19+
- Fixed Project-wide Actions asset failing to reload properly after deleting project's Library folder.
1920

2021
### Changed
2122
- For Unity 6.0 and above, when an `EventSystem` GameObject is created in the Editor it will have the

Packages/com.unity.inputsystem/InputSystem/Editor/ProjectWideActions/ProjectWideActionsAsset.cs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,15 @@ private static void OnPostprocessAllAssets(string[] importedAssets, string[] del
3535
MoveInputManagerAssetActionsToProjectWideInputActionAsset();
3636
migratedInputActionAssets = true;
3737
}
38+
39+
if (!Application.isPlaying)
40+
{
41+
// If the Library folder is deleted, InputSystem will fail to retrieve the assigned Project-wide Asset because this look-up occurs
42+
// during initialization while the Library is being rebuilt. So, afterwards perform another check and assign PWA asset if needed.
43+
var pwaAsset = ProjectWideActionsBuildProvider.actionsToIncludeInPlayerBuild;
44+
if (InputSystem.actions == null && pwaAsset != null)
45+
InputSystem.actions = pwaAsset;
46+
}
3847
}
3948
}
4049

0 commit comments

Comments
 (0)