56 lines
1.7 KiB
C#
56 lines
1.7 KiB
C#
using UnityEngine;
|
|
using UnityEngine.InputSystem.XR;
|
|
using EnglewoodLAB;
|
|
using EnglewoodLAB.UI;
|
|
using EnglewoodLAB.Management;
|
|
using UVC.UI.Commands;
|
|
|
|
namespace EnglewoodLAB.Command
|
|
{
|
|
public class ChangedFloorCommand : ICommand
|
|
{
|
|
private int floorIndex;
|
|
private OrbitalController controller;
|
|
public ChangedFloorCommand(int floorIndex)
|
|
{
|
|
this.floorIndex = floorIndex;
|
|
controller = AppMain.Instance.cameraController;
|
|
}
|
|
|
|
public async void Execute(object? parameter = null)
|
|
{
|
|
var uiIsActive = floorIndex == 2 ? true : false;
|
|
var targetPos = Vector3.zero;
|
|
var curDistance = 0f;
|
|
var curElevation = 0f;
|
|
var curAzimuth= 0f;
|
|
if (uiIsActive)
|
|
{
|
|
targetPos = new Vector3(17f, 0.05f, -2.806954f);
|
|
curDistance = 10f;
|
|
curElevation = 23f;
|
|
curAzimuth = 305f;
|
|
}
|
|
else
|
|
{
|
|
if (SceneMain.Instance.GetManager<EWLUIManager>())
|
|
{
|
|
var leftSidePanel = SceneMain.Instance.GetManager<EWLUIManager>().GetCanvas<StaticCanvas>().GetPanel<LeftSidePanel>();
|
|
leftSidePanel.DeactiveSideToolButton();
|
|
}
|
|
|
|
targetPos = new Vector3(26.7f, 20f, 205.3f);
|
|
curDistance = 60f;
|
|
curElevation = 56;
|
|
curAzimuth = 136f;
|
|
|
|
}
|
|
controller.currentDistance = curDistance;
|
|
controller.currentElevation = curElevation;
|
|
controller.currentAzimuth = curAzimuth;
|
|
|
|
controller.SetTargetPos(targetPos);
|
|
}
|
|
}
|
|
}
|