You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
CrowdControl/Assets/3rd/D2D_Scripts/Gameplay/DoActionOnTap.cs

20 lines
407 B
C#

2 months ago
using UltEvents;
using UnityEngine;
namespace D2D.Common
{
public class DoActionOnTap : MonoBehaviour
{
[SerializeField] private UltEvent action;
private void Update()
{
foreach (Touch touch in Input.touches)
{
if (Input.GetTouch(0).phase == TouchPhase.Began)
action?.Invoke();
}
}
}
}