Scene picker: Added option to add groups of scenes to open
This commit is contained in:
parent
41604b98e7
commit
a86f76904e
28 changed files with 1052 additions and 225 deletions
|
|
@ -7,7 +7,7 @@ namespace Module.NavigationTool.Editor.Toolbar
|
|||
{
|
||||
internal static class ToolbarSettingsUtility
|
||||
{
|
||||
public static IToolbarSettings[] GetAllSettings()
|
||||
public static IToolbarSettings[] GetAllUserSettings()
|
||||
{
|
||||
var list = new List<IToolbarSettings>(8);
|
||||
|
||||
|
|
@ -43,5 +43,42 @@ namespace Module.NavigationTool.Editor.Toolbar
|
|||
|
||||
return list.ToArray();
|
||||
}
|
||||
|
||||
public static IToolbarProjectSettings[] GetAllProjectSettings(ToolbarProjectSettings settings)
|
||||
{
|
||||
var list = new List<IToolbarProjectSettings>(8);
|
||||
|
||||
try
|
||||
{
|
||||
Assembly[] assemblies = AppDomain.CurrentDomain.GetAssemblies();
|
||||
Type iType = typeof(IToolbarProjectSettings);
|
||||
|
||||
for (var i = 0; i < assemblies.Length; i++)
|
||||
{
|
||||
Assembly assembly = assemblies[i];
|
||||
Type[] types = assembly.GetTypes();
|
||||
|
||||
for (var j = 0; j < types.Length; j++)
|
||||
{
|
||||
Type type = types[j];
|
||||
|
||||
if (type.IsInterface || type.IsAbstract || !iType.IsAssignableFrom(type))
|
||||
continue;
|
||||
|
||||
var toolbar = (IToolbarProjectSettings)FormatterServices.GetUninitializedObject(type);
|
||||
toolbar.Initialize(settings);
|
||||
list.Add(toolbar);
|
||||
}
|
||||
}
|
||||
|
||||
list.Sort((s0, s1) => string.Compare(s0.Title, s1.Title, StringComparison.Ordinal));
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
// Fail silently
|
||||
}
|
||||
|
||||
return list.ToArray();
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue