2026-04-17 장보기 목록 버튼 할당 진행중
This commit is contained in:
29
Assets/02_Scripts/Managers/InputManager.cs
Normal file
29
Assets/02_Scripts/Managers/InputManager.cs
Normal file
@@ -0,0 +1,29 @@
|
||||
using System;
|
||||
using UnityEngine;
|
||||
using UnityEngine.InputSystem;
|
||||
|
||||
public class InputManager : MonoBehaviour
|
||||
{
|
||||
public static InputManager Instance;
|
||||
|
||||
//인풋 매니저는 눌린 키에 대한 이벤트만 실행함. 어떤 로직이 등록되어있는지는 모른다.
|
||||
public event Action XRLeftControllerPrimaryButton_Event;
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
if (Instance == null)
|
||||
{
|
||||
Instance = this; //만들어진 자신을 인스턴스로 설정
|
||||
}
|
||||
else
|
||||
{
|
||||
Destroy(gameObject); //이미 인스턴스가 있으면 자신을 파괴
|
||||
}
|
||||
}
|
||||
|
||||
public void XRLeftControllerPrimaryButton(InputAction.CallbackContext ctx)
|
||||
{
|
||||
if(ctx.started)
|
||||
XRLeftControllerPrimaryButton_Event?.Invoke();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user