I have a button implementing the IPointerClickHandler interface.
In the OnPointerClick
function, I check which mouse button has been pressed and I call a function.
How can I change my code so that the function is called while the mouse button is held down?
public void OnPointerClick(PointerEventData eventData)
{
if (eventData.button == PointerEventData.InputButton.Left){
if (FS.FireBEMGT == 1 && !shines360 && mana.baterieSlider.value > 10)
{
shines360 = true;
countdown = 600;
torch360.enabled = true;
mana.baterieSlider.value -= 10;
source.PlayOneShot (klickon, 0.9f);
torch360.range = 20;
thumbNail.SetActive (true);
}
}
if (eventData.button == PointerEventData.InputButton.Right)
{
tooltiptorchlight.SetActive (true);
}