diff --git a/Source/AssetRipper.Export.UnityProjects/Project/SceneExportCollection.cs b/Source/AssetRipper.Export.UnityProjects/Project/SceneExportCollection.cs index f065c7ccb..9e79ba0aa 100644 --- a/Source/AssetRipper.Export.UnityProjects/Project/SceneExportCollection.cs +++ b/Source/AssetRipper.Export.UnityProjects/Project/SceneExportCollection.cs @@ -111,9 +111,8 @@ public class SceneExportCollection : ExportCollection, IComparer @@ -70,9 +82,8 @@ public static partial class SceneHelpers public static bool TryGetScenePath(AssetCollection collection, [NotNullWhen(true)] IBuildSettings? buildSettings, [NotNullWhen(true)] out string? result) { - if (buildSettings is not null && IsSceneName(collection.Name)) + if (buildSettings is not null && TryGetFileNameToSceneIndex(collection.Name, collection.OriginalVersion, out int index)) { - int index = FileNameToSceneIndex(collection.Name, collection.OriginalVersion); if (index >= buildSettings.Scenes.Count) { //This can happen in the following situation: @@ -137,8 +148,6 @@ public static partial class SceneHelpers return false; } - public static bool IsSceneName(string name) => name == MainSceneName || SceneNameFormat.IsMatch(name); - [GeneratedRegex("^level(0|([1-9][0-9]*))$")] private static partial Regex SceneNameFormat { get; } }