<feat> 로봇 정보 패널 (Y버튼) 생성

This commit is contained in:
SOOBEEN HAN
2025-11-11 18:36:52 +09:00
parent 04aaf4f50c
commit 9c1098c0e6
21 changed files with 5448 additions and 197 deletions

View File

@@ -1,23 +1,12 @@
using System;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using TMPro;
using UnityEngine;
using UnityEngine.InputSystem;
using UnityEngine.UI;
public interface IProgramView
{
void ShowMessage(string message);
void DisplayProgram(string programId);
void ShowProgramList(List<string> programIds);
void HideProgramList();
void HideProgramSelectPanel();
public event Action<string> OnCreateProgramClicked;
public event Action OnLoadProgramListRequested; // '불러오기' 버튼 클릭
public event Action<string> OnProgramSelectedToLoad;
public event Action OnOpenProgramClicked;
public event Action OnSaveClicked;
public event Action OnAddPointClicked;
}
public class ProgramView : MonoBehaviour, IProgramView

View File

@@ -0,0 +1,49 @@
using TMPro;
using UnityEngine;
using UnityEngine.InputSystem;
using UnityEngine.InputSystem.XR;
public class RobotInfoView : MonoBehaviour
{
// --- ·Îº¿ Á¤º¸ ÆÐ³Î ---
[SerializeField] private Transform leftControllerTransform;
[SerializeField] private GameObject infoPanel;
[SerializeField] public TextMeshProUGUI motorState;
[SerializeField] public GameObject motorON;
[SerializeField] public GameObject motorOFF;
public InputActionReference showInfoPanel;
private bool isPressingX = false;
private void Start()
{
infoPanel.SetActive(false);
if (showInfoPanel != null) {
showInfoPanel.action.Enable();
showInfoPanel.action.performed += ShowRobotInfoPanel;
}
}
private void OnDestroy()
{
if (showInfoPanel != null)
{
showInfoPanel.action.performed -= ShowRobotInfoPanel;
}
}
public void ShowRobotInfoPanel(InputAction.CallbackContext obj)
{
if (!isPressingX)
{
infoPanel.transform.SetParent(leftControllerTransform);
infoPanel.transform.localPosition = new Vector3(0f, 0.2f, 0f);
infoPanel.transform.localRotation = new Quaternion(0f, 180f, 0f, 0f);
infoPanel.SetActive(true);
}
else
{
infoPanel.SetActive(false);
}
isPressingX = !isPressingX;
}
}

View File

@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: 62084778ceebedc47b1709734dd3fa9f