Files
ArrowBeatTap-Gp/Assets/Scripts/InputHelper.cs
T

21 lines
766 B
C#
Raw Normal View History

2026-06-14 19:25:04 +08:00
using UnityEngine;
public class InputHelper : MonoBehaviour
{
public static InputHelper Instance;
private void Awake()
{
if (Instance == null) Instance = this;
else Destroy(gameObject);
}
// 提供输入状态给UI层调用
public int TouchCount => Input.touchCount;
public Touch GetTouch(int index) => Input.GetTouch(index);
public bool GetMouseButtonDown(int button) => Input.GetMouseButtonDown(button);
public bool GetMouseButton(int button) => Input.GetMouseButton(button);
public bool GetMouseButtonUp(int button) => Input.GetMouseButtonUp(button);
public Vector3 MousePosition => Input.mousePosition;
// public float GetMouseWheelDelta() => Input.GetMouseWheelDelta();
}