63 lines
2.2 KiB
C#
63 lines
2.2 KiB
C#
|
|
using System;
|
|||
|
|
using UnityEngine;
|
|||
|
|
|
|||
|
|
// Presenter<65><72> InteractionView<65><77> <20><><EFBFBD><EFBFBD><EFBFBD>ϱ<EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>̽<EFBFBD>
|
|||
|
|
public interface IInteractionView
|
|||
|
|
{
|
|||
|
|
// VR <20><>Ʈ<EFBFBD>ѷ<EFBFBD><D1B7><EFBFBD> <20>κ<EFBFBD><CEBA><EFBFBD> <20><><EFBFBD>Ҵ<EFBFBD> <20><><EFBFBD><EFBFBD> <20><> <20><EFBFBD>
|
|||
|
|
event Action<RobotData> OnRobotReleased;
|
|||
|
|
// VR <20><>Ʈ<EFBFBD>ѷ<EFBFBD><D1B7><EFBFBD> Ư<><C6AF> <20><><EFBFBD><EFBFBD>Ʈ<EFBFBD><C6AE> Ŭ<><C5AC><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><EFBFBD>
|
|||
|
|
event Action<int> OnPointClicked;
|
|||
|
|
// VR <20><>Ʈ<EFBFBD>ѷ<EFBFBD><D1B7><EFBFBD> <20><><EFBFBD><EFBFBD>Ʈ<EFBFBD><C6AE> <20><><EFBFBD><EFBFBD> <20>巡<EFBFBD><E5B7A1> <20><><EFBFBD><EFBFBD>/<2F><>/<2F><> <20><><EFBFBD><EFBFBD> <20><> <20><EFBFBD>
|
|||
|
|
event Action<int> OnPointDragStart;
|
|||
|
|
event Action<int, Vector3> OnPointDragUpdate; // (<28><><EFBFBD><EFBFBD>Ʈ <20>ε<EFBFBD><CEB5><EFBFBD>, <20><> <20><><EFBFBD><EFBFBD> <20><>ǥ)
|
|||
|
|
event Action<int> OnPointDragEnd;
|
|||
|
|
|
|||
|
|
// Presenter<65><72> ȣ<><C8A3><EFBFBD><EFBFBD> <20>Լ<EFBFBD><D4BC><EFBFBD>
|
|||
|
|
void ShowGhostRobot(RobotData pose);
|
|||
|
|
void HideGhostRobot();
|
|||
|
|
void ShowDragArrow(Vector3 position);
|
|||
|
|
void HideDragArrow();
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
// (<28><> <20><>ũ<EFBFBD><C5A9>Ʈ<EFBFBD><C6AE> VR <20><>Ʈ<EFBFBD>ѷ<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>ִ<EFBFBD> <20><><EFBFBD><EFBFBD> <20>پ<EFBFBD><D9BE><EFBFBD> <20>մϴ<D5B4>)
|
|||
|
|
public class InteractionView : MonoBehaviour, IInteractionView
|
|||
|
|
{
|
|||
|
|
public event Action<RobotData> OnRobotReleased;
|
|||
|
|
public event Action<int> OnPointClicked;
|
|||
|
|
public event Action<int> OnPointDragStart;
|
|||
|
|
public event Action<int, Vector3> OnPointDragUpdate;
|
|||
|
|
public event Action<int> OnPointDragEnd;
|
|||
|
|
|
|||
|
|
void Update()
|
|||
|
|
{
|
|||
|
|
// <20><>Ʈ<EFBFBD>ѷ<EFBFBD><D1B7><EFBFBD> <20>κ<EFBFBD><CEBA><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>ִ<EFBFBD><D6B4><EFBFBD> <20><><EFBFBD><EFBFBD>
|
|||
|
|
// if (IsGrabbingRobot()) { ... }
|
|||
|
|
|
|||
|
|
// <20><>Ʈ<EFBFBD>ѷ<EFBFBD> <20><EFBFBD> <20><>ư<EFBFBD><C6B0> <20><><EFBFBD><EFBFBD> <20><>
|
|||
|
|
// if (OnGrabRelease())
|
|||
|
|
// {
|
|||
|
|
// RobotData currentPose = GetCurrentRobotPose();
|
|||
|
|
// OnRobotReleased?.Invoke(currentPose); // 2. "<22><>ġ Ȯ<><C8AE>?" <20>˾<EFBFBD> <20><>û
|
|||
|
|
// }
|
|||
|
|
|
|||
|
|
// <20><>Ʈ<EFBFBD>ѷ<EFBFBD><D1B7><EFBFBD> <20><><EFBFBD><EFBFBD>Ʈ<EFBFBD><C6AE> Ŭ<><C5AC><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><>
|
|||
|
|
// if (OnPointClick(out int clickedPointIndex))
|
|||
|
|
// {
|
|||
|
|
// OnPointClicked?.Invoke(clickedPointIndex); // 8. "<22>̵<EFBFBD>/<2F><><EFBFBD><EFBFBD>?" <20>˾<EFBFBD> <20><>û
|
|||
|
|
// }
|
|||
|
|
|
|||
|
|
// <20><>Ʈ<EFBFBD>ѷ<EFBFBD><D1B7><EFBFBD> <20><><EFBFBD><EFBFBD>Ʈ<EFBFBD><C6AE> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>(<28>巡<EFBFBD><E5B7A1> <20><><EFBFBD><EFBFBD>)
|
|||
|
|
// if (OnPointHold(out int draggedPointIndex))
|
|||
|
|
// {
|
|||
|
|
// OnPointDragStart?.Invoke(draggedPointIndex); // 5. <20>巡<EFBFBD><E5B7A1> <20><><EFBFBD><EFBFBD>
|
|||
|
|
// }
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
// --- Presenter<65><72> ȣ<><C8A3><EFBFBD><EFBFBD> <20>Լ<EFBFBD><D4BC><EFBFBD> ---
|
|||
|
|
public void ShowGhostRobot(RobotData pose) { /* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>κ<EFBFBD>2 Ȱ<><C8B0>ȭ <20><> <20><>ġ <20><><EFBFBD><EFBFBD> */ }
|
|||
|
|
public void HideGhostRobot() { /* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>κ<EFBFBD>2 <20><>Ȱ<EFBFBD><C8B0>ȭ */ }
|
|||
|
|
public void ShowDragArrow(Vector3 position) { /* <20>巡<EFBFBD><EFBFBD> ȭ<><C8AD>ǥ UI Ȱ<><C8B0>ȭ <20><> <20><>ġ <20><><EFBFBD><EFBFBD> */ }
|
|||
|
|
public void HideDragArrow() { /* <20>巡<EFBFBD><EFBFBD> ȭ<><C8AD>ǥ UI <20><>Ȱ<EFBFBD><C8B0>ȭ */ }
|
|||
|
|
}
|