// Action을 사용한 InputManager
public class InputManager
{
public Action KeyAction = null;
public void OnUpdate()
{
// 뭔가 입력이 된 상태
if (Input.anyKey == false)
return;
// KeyAction이 구독 된 상태라면 구독된 모든 함수 수행
if (KeyAction != null)
KeyAction.Invoke();
}
}