Skip to content

Commit

Permalink
Merge pull request #621 from ReinaS-64892/Exception-occur-when-no-sel…
Browse files Browse the repository at this point in the history
…ect-migration-target-prefab

fix: Exception occur when no select migration target prefab.
  • Loading branch information
ReinaS-64892 authored Aug 15, 2024
2 parents dcc16bf + 1e13435 commit 94b41db
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions Editor/Migration/MigratorWindow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,6 @@ void initialize()
}
foreach (var prefabKV in PrefabInfo)
{
Debug.Log(prefabKV.Value.Prefab.name);
var toggle = PrefabToToggle[prefabKV.Key];
var parentPrefab = PrefabUtility.GetCorrespondingObjectFromSource(prefabKV.Value.Prefab);
if (parentPrefab != null && PrefabToToggle.ContainsKey(parentPrefab))
Expand Down Expand Up @@ -137,8 +136,11 @@ void CreateGUI()
void Migration()
{
var prefabTarget = MigrationTarget.Where(kv => kv.Value).Select(kv => kv.Key).ToHashSet();
AAOMigrator.MigratePartial(PrefabMinimumSaveDataVersion.Where(kv => prefabTarget.Contains(kv.Key)).Min(kv => kv.Value)
, prefabTarget, Scene.Where(kv => kv.Value).Select(kv => kv.Key).ToHashSet());

var saveDataVersionValues = PrefabMinimumSaveDataVersion.Where(kv => prefabTarget.Contains(kv.Key)).Select(i => i.Value);
if (saveDataVersionValues.Any() is false) { saveDataVersionValues = saveDataVersionValues.Append(0); }

AAOMigrator.MigratePartial(saveDataVersionValues.Min(), prefabTarget, Scene.Where(kv => kv.Value).Select(kv => kv.Key).ToHashSet());

this.Close();
}
Expand Down

0 comments on commit 94b41db

Please sign in to comment.