Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
112 views
in Technique[技术] by (71.8m points)

c# - How to use OnPointerUp method in a UI button event trigger

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

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

2.1m questions

2.1m answers

60 comments

57.0k users

...