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
|
|
@ -0,0 +1,48 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Module.NavigationTool.Editor.Toolbar
|
||||
{
|
||||
internal sealed class ToolbarScenePickerProjectSettings : IToolbarProjectSettings
|
||||
{
|
||||
public string Title => "Scene";
|
||||
public bool IsSettingsDirty { get; private set; }
|
||||
|
||||
private StringReordableListDrawer assetLabelList;
|
||||
private SceneGroupReordableListDrawer sceneGroupList;
|
||||
|
||||
private ToolbarProjectSettings projectSettings;
|
||||
private Settings settings;
|
||||
|
||||
public void Initialize(ToolbarProjectSettings projectSettings)
|
||||
{
|
||||
this.projectSettings = projectSettings;
|
||||
settings = projectSettings.GetValueAs<Settings>();
|
||||
|
||||
assetLabelList = new StringReordableListDrawer(settings.labels, "Scene sorting by Asset label");
|
||||
assetLabelList.onChanged += ToolScenePicker.SetAsDirty;
|
||||
|
||||
sceneGroupList = new SceneGroupReordableListDrawer(settings.sceneGroups.groups, "Scene groups");
|
||||
sceneGroupList.onChanged += ToolScenePicker.SetAsDirty;
|
||||
}
|
||||
|
||||
public void Draw()
|
||||
{
|
||||
assetLabelList.DoLayoutList();
|
||||
sceneGroupList.DoLayoutList();
|
||||
IsSettingsDirty = assetLabelList.IsDirty || sceneGroupList.IsDirty;
|
||||
}
|
||||
|
||||
public void SetSettingsValue()
|
||||
{
|
||||
projectSettings.SetValue(settings);
|
||||
}
|
||||
|
||||
[Serializable]
|
||||
public sealed class Settings
|
||||
{
|
||||
public List<string> labels = new();
|
||||
public SceneGroupArray sceneGroups = new();
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue