Adding Convert feature to Actor context menu.

This commit is contained in:
Jean-Baptiste Perrier
2021-01-09 23:21:31 +01:00
parent 0e768694b5
commit d2888d0007
2 changed files with 46 additions and 1 deletions

View File

@@ -55,6 +55,28 @@ namespace FlaxEditor.Windows
b = contextMenu.AddButton("Duplicate", Editor.SceneEditing.Duplicate);
b.Enabled = hasSthSelected;
var convertMenu = contextMenu.AddChildMenu("Convert");
var convertActorCm = convertMenu.ContextMenu;
for (int i = 0; i < SpawnActorsGroups.Length; i++)
{
var group = SpawnActorsGroups[i];
if (group.Types.Length == 1)
{
var type = group.Types[0].Value;
convertActorCm.AddButton(group.Types[0].Key, () => Convert(type));
}
else
{
var groupCm = convertActorCm.AddChildMenu(group.Name).ContextMenu;
for (int j = 0; j < group.Types.Length; j++)
{
var type = group.Types[j].Value;
groupCm.AddButton(group.Types[j].Key, () => Convert(type));
}
}
}
b = contextMenu.AddButton("Delete", Editor.SceneEditing.Delete);
b.Enabled = hasSthSelected;