Skip to content

Commit 2f0c02a

Browse files
committed
FIX: Avoid problems with CI and reimports
1 parent d5f8543 commit 2f0c02a

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

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

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -260,10 +260,20 @@ private static void GenerateWrapperCode(AssetImportContext ctx, InputActionAsset
260260
// script assets have to be imported before all other assets, and are not allowed to be added to the import queue during
261261
// asset import. So instead we register a callback to trigger a delayed asset refresh which should then pick up the
262262
// changed/added script, and trigger a new import.
263-
EditorApplication.delayCall += AssetDatabase.Refresh;
263+
if (++_importedAssetsSinceLastRefresh == 1)
264+
EditorApplication.update += AssetDatabase.Refresh;
264265
}
265266
}
266267

268+
private static int _importedAssetsSinceLastRefresh = 0;
269+
270+
private void RefreshGeneratedAssets()
271+
{
272+
EditorApplication.update -= RefreshGeneratedAssets;
273+
_importedAssetsSinceLastRefresh = 0;
274+
AssetDatabase.Refresh();
275+
}
276+
267277
#if UNITY_INPUT_SYSTEM_PROJECT_WIDE_ACTIONS
268278
internal static IEnumerable<InputActionReference> LoadInputActionReferencesFromAsset(string assetPath)
269279
{

0 commit comments

Comments
 (0)