// Copyright (c) 2012-2023 Wojciech Figat. All rights reserved.
using System;
using FlaxEngine;
namespace FlaxEditor.Tools.Foliage.Undo
{
///
/// The foliage editing action that handles changing selected foliage actor instance index.
///
///
[Serializable]
public sealed class EditSelectedInstanceIndexAction : IUndoAction
{
[Serialize]
private int _before;
[Serialize]
private int _after;
///
/// Initializes a new instance of the class.
///
/// The selected index before.
/// The selected index after.
public EditSelectedInstanceIndexAction(int before, int after)
{
_before = before;
_after = after;
}
///
public string ActionString => "Edit selected foliage instance index";
///
public void Dispose()
{
}
///
public void Do()
{
Editor.Instance.Windows.ToolboxWin.Foliage.Edit.Mode.SelectedInstanceIndex = _after;
}
///
public void Undo()
{
Editor.Instance.Windows.ToolboxWin.Foliage.Edit.Mode.SelectedInstanceIndex = _before;
}
}
}