Files
EnglewoodLAB/Assets/Scripts/Command/ObjectCommand/SelectedMachineCommand.cs

27 lines
737 B
C#
Raw Normal View History

using EnglewoodLAB;
using UVC.UI.Commands;
namespace EngleWoodLAB.UI.Command
{
public class SelectedMachineCommand : ICommand
{
private Machine machine;
public SelectedMachineCommand(Machine machine)
{
this.machine = machine;
}
public SelectedMachineCommand(string machineCode)
{
var building = SceneMain.Instance.building;
var machines = building.GetMachines();
this.machine = machines.Find(x => x.code == machineCode);
}
public void Execute(object? parameter = null)
{
var viewManager = SceneMain.Instance.viewManager;
viewManager.SetTargetPosToMachine(machine);
}
}
}