<fix> 버그 수정 (hover시 mat 설정, 에러 mat 설정, 환경설정-다른 프로그램 열기 설정, 팝업 위치 설정)
This commit is contained in:
@@ -29,6 +29,7 @@ public class EnvView : MonoBehaviour
|
||||
private bool isPressingMenu = false;
|
||||
|
||||
public event Action<bool> OnToggleClicked;
|
||||
public event Action OnLoadProgramListRequested;
|
||||
|
||||
void Start()
|
||||
{
|
||||
@@ -113,6 +114,8 @@ public class EnvView : MonoBehaviour
|
||||
ProgramEnterPanel.SetActive(true);
|
||||
NewProgramPanel.SetActive(false);
|
||||
OriginalProgramPanel.SetActive(true);
|
||||
|
||||
OnLoadProgramListRequested?.Invoke();
|
||||
}
|
||||
|
||||
private void OpenNewProgramPanel()
|
||||
|
||||
@@ -9,6 +9,7 @@ public enum HandSide { Left, Right }
|
||||
|
||||
public class InteractionView : MonoBehaviour
|
||||
{
|
||||
public event Action<bool> OnRobotHoverStateChanged;
|
||||
public event Action OnRobotGrabStart;
|
||||
public event Action<Vector3, Quaternion> OnRobotGrabbed;
|
||||
public event Action<RobotData> OnRobotReleased;
|
||||
@@ -91,6 +92,8 @@ public class InteractionView : MonoBehaviour
|
||||
// XRI 이벤트 구독
|
||||
baseInteractor.selectEntered.AddListener(HandleGrabStart);
|
||||
baseInteractor.selectExited.AddListener(HandleGrabEnd);
|
||||
baseInteractor.hoverEntered.AddListener(OnHoverEntered);
|
||||
baseInteractor.hoverExited.AddListener(OnHoverExited);
|
||||
|
||||
TryInitializeHapticDevice();
|
||||
|
||||
@@ -203,6 +206,24 @@ public class InteractionView : MonoBehaviour
|
||||
currentGrabbedPointIndex = -1;
|
||||
}
|
||||
|
||||
private void OnHoverEntered(HoverEnterEventArgs args)
|
||||
{
|
||||
// 호버한 물체가 '로봇'인지 확인
|
||||
if (args.interactableObject.transform.CompareTag("RobotArm"))
|
||||
{
|
||||
OnRobotHoverStateChanged?.Invoke(true);
|
||||
}
|
||||
}
|
||||
|
||||
// 호버 종료 시 호출
|
||||
private void OnHoverExited(HoverExitEventArgs args)
|
||||
{
|
||||
if (args.interactableObject.transform.CompareTag("RobotArm"))
|
||||
{
|
||||
OnRobotHoverStateChanged?.Invoke(false);
|
||||
}
|
||||
}
|
||||
|
||||
// 클릭/드래그 구분하는 타이머 코루틴
|
||||
private IEnumerator ClickOrDragTimer()
|
||||
{
|
||||
|
||||
@@ -7,6 +7,7 @@ public class PointManagerView : MonoBehaviour
|
||||
{
|
||||
[SerializeField] private GameObject pointPrefab;
|
||||
private List<GameObject> activePoints = new List<GameObject>();
|
||||
public Transform robotBaseTransform; // 로봇좌표의 기준이 되는 축 위치
|
||||
|
||||
[SerializeField] public GameObject movingAlert;
|
||||
[SerializeField]
|
||||
@@ -28,8 +29,21 @@ public class PointManagerView : MonoBehaviour
|
||||
|
||||
public void CreatePoint(RobotData pose, int index)
|
||||
{
|
||||
Vector3 position = ConvertRobotDataToVector3(pose);
|
||||
GameObject pointObj = Instantiate(pointPrefab, position, Quaternion.identity, this.transform);
|
||||
Vector3 localPos = ConvertRobotDataToVector3(pose);
|
||||
Vector3 worldPos = localPos;
|
||||
|
||||
// 로봇 Base가 있다면, 로컬 좌표를 월드 좌표로 변환
|
||||
if (robotBaseTransform != null)
|
||||
{
|
||||
worldPos = robotBaseTransform.TransformPoint(localPos);
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.LogWarning("PointManagerView: RobotBaseTransform이 할당되지 않아 월드 원점 기준으로 생성됩니다.");
|
||||
}
|
||||
|
||||
// 변환된 월드 좌표에 생성
|
||||
GameObject pointObj = Instantiate(pointPrefab, worldPos, Quaternion.identity, this.transform);
|
||||
activePoints.Add(pointObj);
|
||||
|
||||
RobotPoint pointComponent = pointObj.GetComponent<RobotPoint>();
|
||||
|
||||
@@ -78,17 +78,18 @@ public class PopupView : MonoBehaviour, IPopupView
|
||||
|
||||
public void ShowDeletePopup(Vector3 popPose)
|
||||
{
|
||||
deletePopupPanel.transform.position = popPose;
|
||||
deletePopupPanel.transform.LookAt(Camera.main.transform);
|
||||
deletePopupPanel.transform.Rotate(0, 180, 0);
|
||||
//deletePopupPanel.transform.position = popPose;
|
||||
//deletePopupPanel.transform.LookAt(Camera.main.transform);
|
||||
//deletePopupPanel.transform.Rotate(0, 180, 0);
|
||||
deletePopupPanel.SetActive(true);
|
||||
}
|
||||
|
||||
public void ShowOptionPopup(Vector3 popPose)
|
||||
{
|
||||
optionPopupPanel.transform.position = popPose;
|
||||
optionPopupPanel.transform.LookAt(Camera.main.transform);
|
||||
optionPopupPanel.transform.Rotate(0, 180, 0);
|
||||
optionPopupPanel.transform.localRotation = Quaternion.identity;
|
||||
//optionPopupPanel.transform.LookAt(Camera.main.transform);
|
||||
//optionPopupPanel.transform.Rotate(0, 180, 0);
|
||||
optionPopupPanel.SetActive(true);
|
||||
}
|
||||
|
||||
|
||||
@@ -7,9 +7,6 @@ using UnityEngine.UI;
|
||||
|
||||
public class ProgramView : MonoBehaviour
|
||||
{
|
||||
// --- UI 요소 참조 ---
|
||||
[SerializeField] private Button loadProgramButton;
|
||||
|
||||
// --- 프로그램 목록 패널 ---
|
||||
[SerializeField] private GameObject programSelectPanel;
|
||||
[SerializeField] private GameObject programNewPanel;
|
||||
@@ -21,6 +18,7 @@ public class ProgramView : MonoBehaviour
|
||||
[SerializeField] private Button[] numberPadButtons; // 0-9까지의 버튼 배열
|
||||
[SerializeField] private Button backspaceButton;
|
||||
[SerializeField] private Button createProgramButton;
|
||||
[SerializeField] private Button loadProgramButton;
|
||||
[SerializeField] private Button openProgramButton;
|
||||
[SerializeField] private Button closeProgramListButton;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user