0.8.1: Fixed issue, where scenes in build settings and addressabels would appear multiple times, due to scenes in build settings automatically being added to addressables

This commit is contained in:
Anders Ejlersen 2021-09-26 21:49:40 +02:00
parent 6fc88d3986
commit 7b5efffaf8
2 changed files with 12 additions and 10 deletions

View file

@ -25,8 +25,7 @@ namespace Module.NavigationTool.Editor.Tools
{
if (!IS_DIRTY)
return;
EditorBuildSettingsScene[] scenes = EditorBuildSettings.scenes;
var listNames = new List<string>();
var listPaths = new List<string>();
@ -52,7 +51,7 @@ namespace Module.NavigationTool.Editor.Tools
if (string.IsNullOrEmpty(scenes[i].path))
continue;
listNames.Add($"{Path.GetFileNameWithoutExtension(scenes[i].path)} \tBuild settings");
listNames.Add($"{Path.GetFileNameWithoutExtension(scenes[i].path)} \tBuild settings");
listPaths.Add(scenes[i].path);
}
}
@ -69,16 +68,15 @@ namespace Module.NavigationTool.Editor.Tools
for (var j = 0; j < assetPaths.Length; j++)
{
string path = assetPaths[j];
if (listPaths.Contains(path))
continue;
var scene = AssetDatabase.LoadAssetAtPath<SceneAsset>(path);
if (scene == null)
continue;
if (listPaths.Contains(path))
continue;
listNames.Add($"{Path.GetFileNameWithoutExtension(path)} \tAsset bundle");
listNames.Add($"{Path.GetFileNameWithoutExtension(path)} \tAsset bundle");
listPaths.Add(path);
}
}
@ -102,7 +100,11 @@ namespace Module.NavigationTool.Editor.Tools
continue;
string path = assets[i].AssetPath;
listNames.Add($"{Path.GetFileNameWithoutExtension(path)} \tAddressable");
if (listPaths.Contains(path))
continue;
listNames.Add($"{Path.GetFileNameWithoutExtension(path)} \tAddressable");
listPaths.Add(path);
}

View file

@ -1,6 +1,6 @@
{
"name": "com.module.navigationtool",
"version": "0.8.0",
"version": "0.8.1",
"displayName": "Module.NavigationTool",
"description": "Support for navigation tools, like favorites, history and toolbars",
"unity": "2019.2",