Files
MMORPG/Assets/Scripts/Managers/InputManager.cs
cooney ce83f21c93 UI 자동화를 위해 바인딩 기능 구현
- 유니티 에셋 인증 오류로 meta 재생성
2026-01-25 01:31:34 +09:00

42 lines
902 B
C#

using System;
using UnityEngine;
using UnityEngine.EventSystems;
public class InputManager
{
public Action KeytAction = null;
public Action<Define.MouseEvent> MouseAction = null;
bool _pressed = false;
public void OnUpdate()
{
if (EventSystem.current.IsPointerOverGameObject())
{
return;
}
if (Input.anyKey && KeytAction != null)
{
KeytAction.Invoke();
}
if (MouseAction != null)
{
if (Input.GetMouseButton(0))
{
MouseAction.Invoke(Define.MouseEvent.Press);
_pressed = true;
}
else
{
if (_pressed)
{
MouseAction.Invoke(Define.MouseEvent.Click);
}
_pressed = false;
}
}
}
}