Skip to content

Commit a13b163

Browse files
committed
Try another fix
1 parent 958b22c commit a13b163

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

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

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -260,11 +260,24 @@ 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-
AssetDatabase.ImportAsset(wrapperFilePath);
263+
//AssetDatabase.ImportAsset(wrapperFilePath);
264264
// TODO Temporary disabled, reenable: EditorApplication.delayCall += AssetDatabase.Refresh;
265+
EditorApplication.delayCall += AssetDatabase.Refresh;
266+
if (++_importedAssetsSinceLastRefresh == 1)
267+
EditorApplication.update += AssetDatabase.Refresh;
265268
}
266269
}
267270

271+
private static int _importedAssetsSinceLastRefresh = 0;
272+
273+
private void RefreshGeneratedAssets()
274+
{
275+
EditorApplication.update -= RefreshGeneratedAssets;
276+
_importedAssetsSinceLastRefresh = 0;
277+
AssetDatabase.Refresh();
278+
}
279+
280+
268281
#if UNITY_INPUT_SYSTEM_PROJECT_WIDE_ACTIONS
269282
internal static IEnumerable<InputActionReference> LoadInputActionReferencesFromAsset(string assetPath)
270283
{

0 commit comments

Comments
 (0)