diff --git a/Editor/Core/Config/Common/ImportProjectSettings.cs b/Editor/Core/Config/Common/ImportProjectSettings.cs index 78d24370..6331fbb1 100644 --- a/Editor/Core/Config/Common/ImportProjectSettings.cs +++ b/Editor/Core/Config/Common/ImportProjectSettings.cs @@ -41,6 +41,7 @@ public class ImportProjectSettings : OptionalExecutor public override int Priority => Constants.Priority.ProjectSettingsImport; public override string Description => "Import ProjectSettings from games with globalgamemanagers"; public long IncludedSettings; + public bool LogImportErrors; private AssetsManager assetsManager; private YAMLExportManager exportManager; private PPtrExporterInfo pptrExporterInfo; @@ -125,9 +126,18 @@ private void ExportGlobalGameManagers(AssetsFileInstance globalGameManagersFile, fileName = Enum.GetName(typeof(AssetClassID), info.TypeId); } - AssetExternal assetExternal = assetsManager.GetExtAsset(globalGameManagersFile, 0, info.PathId); - var collection = new ProjectSettingCollection { Assets = { assetExternal } }; - SaveCollection(collection, null, Path.Combine(outputProjectSettingsDirectory, $"{fileName}.{collection.ExportExtension}"), unityVersion); + try + { + AssetExternal assetExternal = assetsManager.GetExtAsset(globalGameManagersFile, 0, info.PathId); + var collection = new ProjectSettingCollection { Assets = { assetExternal } }; + SaveCollection(collection, null, Path.Combine(outputProjectSettingsDirectory, $"{fileName}.{collection.ExportExtension}"), unityVersion); + } + catch (Exception exception) + { + if (LogImportErrors) + Debug.LogError($"Caught an error when trying to import external asset from path ID {info.PathId} of the game managers file: {exception}"); + } + } } diff --git a/UXML/Settings/ImportProjectSettings.UXML b/UXML/Settings/ImportProjectSettings.UXML index 6a474887..a45e4b63 100644 --- a/UXML/Settings/ImportProjectSettings.UXML +++ b/UXML/Settings/ImportProjectSettings.UXML @@ -1,13 +1,10 @@ - - - - - - - + + + + + + + + + -