I want a method to run when a UI button is pressed however when I try to select the method from an event trigger list however it does not appear even though the method is public. I am also implementing IPointerDownHandler, IPointerUpHandler in the class. For the purpose of the behaviour, I can use OnClick() as I need another method to run when OnPointerUp.
The methods I want to run when the button is clicked
public void OnPointerDown(PointerEventData pointerEventData)
{
isPressed = true;
}
public void OnPointerUp(PointerEventData pointerEventData)
{
isPressed = false;
}
Method not appearing in the function section
question from:
https://stackoverflow.com/questions/65892594/how-to-use-onpointerup-method-in-a-ui-button-event-trigger 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…