2025-10-30 09:31:05 +09:00
|
|
|
|
using System;
|
|
|
|
|
|
using UnityEngine;
|
|
|
|
|
|
using UnityEngine.UI;
|
|
|
|
|
|
using TMPro;
|
2025-11-06 20:14:27 +09:00
|
|
|
|
using Unity.XR.CoreUtils;
|
2025-10-30 09:31:05 +09:00
|
|
|
|
|
|
|
|
|
|
public enum PopupResponse
|
|
|
|
|
|
{
|
2025-11-06 20:14:27 +09:00
|
|
|
|
InsConfirm, // <20><><EFBFBD><EFBFBD> Ȯ<><C8AE>
|
|
|
|
|
|
ModConfirm, // <20><><EFBFBD><EFBFBD> Ȯ<><C8AE>
|
|
|
|
|
|
Move, // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>̵<EFBFBD>
|
|
|
|
|
|
Delete, // <20><><EFBFBD><EFBFBD>
|
|
|
|
|
|
DelConfirm, // <20><><EFBFBD><EFBFBD> Ȯ<><C8AE>
|
|
|
|
|
|
Cancel // <20><><EFBFBD><EFBFBD>
|
2025-10-30 09:31:05 +09:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public interface IPopupView
|
|
|
|
|
|
{
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public class PopupView : MonoBehaviour, IPopupView
|
|
|
|
|
|
{
|
|
|
|
|
|
public event Action<PopupResponse> OnPopupResponse;
|
|
|
|
|
|
|
2025-11-06 20:14:27 +09:00
|
|
|
|
[SerializeField] private GameObject confirmPopupPanel;
|
|
|
|
|
|
[SerializeField] private GameObject modifyPopupPanel;
|
|
|
|
|
|
[SerializeField] private GameObject deletePopupPanel;
|
|
|
|
|
|
[SerializeField] private GameObject optionPopupPanel;
|
2025-10-30 09:31:05 +09:00
|
|
|
|
|
2025-11-06 20:14:27 +09:00
|
|
|
|
[SerializeField] private Button ins_confirmButton; // '<27><><EFBFBD><EFBFBD>Ȯ<EFBFBD><C8AE>' <20><>ư
|
|
|
|
|
|
[SerializeField] private Button mod_confirmButton; // '<27><><EFBFBD><EFBFBD>Ȯ<EFBFBD><C8AE>' <20><>ư
|
|
|
|
|
|
[SerializeField] private Button moveButton; // '<27>̵<EFBFBD>' <20><>ư
|
|
|
|
|
|
[SerializeField] private Button deleteButton; // '<27><><EFBFBD><EFBFBD>' <20><>ư
|
|
|
|
|
|
[SerializeField] private Button del_confirmButton; // '<27><><EFBFBD><EFBFBD>Ȯ<EFBFBD><C8AE>' <20><>ư
|
|
|
|
|
|
[SerializeField] private Button[] cancelButton; // '<27><><EFBFBD><EFBFBD>' <20><>ư
|
2025-10-30 09:31:05 +09:00
|
|
|
|
|
|
|
|
|
|
void Start()
|
|
|
|
|
|
{
|
2025-11-06 20:14:27 +09:00
|
|
|
|
ins_confirmButton.onClick.AddListener(() => OnPopupResponse?.Invoke(PopupResponse.InsConfirm));
|
|
|
|
|
|
mod_confirmButton.onClick.AddListener(() => OnPopupResponse?.Invoke(PopupResponse.ModConfirm));
|
|
|
|
|
|
moveButton.onClick.AddListener(() => OnPopupResponse?.Invoke(PopupResponse.Move));
|
|
|
|
|
|
deleteButton.onClick.AddListener(() => OnPopupResponse?.Invoke(PopupResponse.Delete));
|
|
|
|
|
|
del_confirmButton.onClick.AddListener(() => OnPopupResponse?.Invoke(PopupResponse.DelConfirm));
|
|
|
|
|
|
for (int i = 0; i < cancelButton.Length; i++)
|
|
|
|
|
|
cancelButton[i].onClick.AddListener(() => OnPopupResponse?.Invoke(PopupResponse.Cancel));
|
2025-10-30 09:31:05 +09:00
|
|
|
|
|
2025-11-06 20:14:27 +09:00
|
|
|
|
confirmPopupPanel.SetActive(false);
|
|
|
|
|
|
modifyPopupPanel.SetActive(false);
|
|
|
|
|
|
deletePopupPanel.SetActive(false);
|
|
|
|
|
|
optionPopupPanel.SetActive(false);
|
2025-10-30 09:31:05 +09:00
|
|
|
|
}
|
|
|
|
|
|
|
2025-11-06 20:14:27 +09:00
|
|
|
|
public void ShowConfirmPopup(Transform popPose)
|
2025-10-30 09:31:05 +09:00
|
|
|
|
{
|
2025-11-06 20:14:27 +09:00
|
|
|
|
confirmPopupPanel.transform.SetPositionAndRotation(popPose.position, Quaternion.identity);
|
|
|
|
|
|
confirmPopupPanel.SetActive(true);
|
2025-10-30 09:31:05 +09:00
|
|
|
|
}
|
|
|
|
|
|
|
2025-11-06 20:14:27 +09:00
|
|
|
|
public void ShowModifyPopup(Transform popPose)
|
2025-10-30 09:31:05 +09:00
|
|
|
|
{
|
2025-11-06 20:14:27 +09:00
|
|
|
|
modifyPopupPanel.transform.SetPositionAndRotation(popPose.position, Quaternion.identity);
|
|
|
|
|
|
modifyPopupPanel.SetActive(true);
|
|
|
|
|
|
}
|
2025-10-30 09:31:05 +09:00
|
|
|
|
|
2025-11-06 20:14:27 +09:00
|
|
|
|
public void ShowDeletePopup(Transform popPose)
|
|
|
|
|
|
{
|
|
|
|
|
|
deletePopupPanel.transform.SetPositionAndRotation(popPose.position, Quaternion.identity);
|
|
|
|
|
|
deletePopupPanel.SetActive(true);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void ShowOptionPopup(Transform popPose)
|
|
|
|
|
|
{
|
|
|
|
|
|
optionPopupPanel.transform.SetPositionAndRotation(popPose.position, Quaternion.identity);
|
|
|
|
|
|
optionPopupPanel.SetActive(true);
|
2025-10-30 09:31:05 +09:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void HidePopup()
|
|
|
|
|
|
{
|
2025-11-06 20:14:27 +09:00
|
|
|
|
confirmPopupPanel.SetActive(false);
|
|
|
|
|
|
modifyPopupPanel.SetActive(false);
|
|
|
|
|
|
deletePopupPanel.SetActive(false);
|
|
|
|
|
|
optionPopupPanel.SetActive(false);
|
2025-10-30 09:31:05 +09:00
|
|
|
|
}
|
|
|
|
|
|
}
|