<feat> 로봇 정보 패널 (Y버튼) 생성
This commit is contained in:
@@ -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
|
||||
|
||||
49
Assets/Scripts/View/RobotInfoVew.cs
Normal file
49
Assets/Scripts/View/RobotInfoVew.cs
Normal 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;
|
||||
}
|
||||
}
|
||||
2
Assets/Scripts/View/RobotInfoVew.cs.meta
Normal file
2
Assets/Scripts/View/RobotInfoVew.cs.meta
Normal file
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 62084778ceebedc47b1709734dd3fa9f
|
||||
Reference in New Issue
Block a user