Files
AZTECH_WB/Assets/Scripts/Command/ObjectCommand/SelectedMachineCommand.cs
정영민 986886a260 [정영민] 아즈텍 프로젝트 OCTOPUS TWIN 템플릿 적용
26.02.26
- XRLib 추가 및 적용
- 아즈텍 프로젝트 OCTOPUS TWIN 템플릿 적용
2026-02-26 17:26:55 +09:00

48 lines
1.5 KiB
C#

using AZTECHWB.Core;
using AZTECHWB.Management;
using AZTECHWB.UI;
using UVC.UI.Commands;
namespace AZTECHWB.Command
{
public class SelectedMachineCommand : ICommand
{
private bool isSimulation;
Machine machine;
public SelectedMachineCommand(Machine machine, bool isSimulation)
{
this.machine = machine;
this.isSimulation = isSimulation;
}
public async void Execute(object? parameter = null)
{
if (isSimulation)
{
var aiSimulationManager = AZTECHSceneMain.Instance.GetManager<AISimulationManager>();
var data = await aiSimulationManager.SetSimulationResult(machine);
var InfoPanel = AZTECHSceneMain.Instance.GetManager<AZTECHUIManager>().GetCanvas<PopupCanvas>().GetPanel<AISimulationInfoPanel>();
InfoPanel.SetDataInfo(data);
}
else
{
var controller = AZTECHAppMain.Instance.cameraController;
if (controller.viewMode != ViewMode.PerspectiveView)
{
controller.SetViewMode(ViewMode.PerspectiveView);
}
var centerPos = machine.centerPos;
controller.currentAzimuth = machine.focusAzimuth;
controller.currentElevation = machine.focusElevation;
controller.currentDistance = machine.focusDistance;
controller.SetTargetPos(centerPos);
}
}
}
}