I have an OnPointerClick() function that sometimes gets fired twice if I keep clicking on multiple buttons at a stretch, even though I have pressed this button only once. This is happening in the new Input UI System. How do I stop this from happening?
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.EventSystems;
using UnityEngine.UI;
public class ClickableButtons : MonoBehaviour, IPointerClickHandler {
public void OnPointerClick (PointerEventData eventData) {
Debug.Log("Clicked"); //Called twice most of the time when button is pressed once
}
}