Support undo.
This commit is contained in:
@@ -55,28 +55,30 @@ 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++)
|
||||
if (Editor.SceneEditing.SelectionCount == 1)
|
||||
{
|
||||
var group = SpawnActorsGroups[i];
|
||||
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++)
|
||||
if (group.Types.Length == 1)
|
||||
{
|
||||
var type = group.Types[j].Value;
|
||||
groupCm.AddButton(group.Types[j].Key, () => Convert(type));
|
||||
var type = group.Types[0].Value;
|
||||
convertActorCm.AddButton(group.Types[0].Key, () => Editor.SceneEditing.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, () => Editor.SceneEditing.Convert(type));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
b = contextMenu.AddButton("Delete", Editor.SceneEditing.Delete);
|
||||
b.Enabled = hasSthSelected;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user