Hello, i am beginner is c# language and i have question, how to call method just once.
The given code uses two methods OnMouseDown() and OnMouseUp).
Basically when the mouse is clicked on the object, color changes to red, and when mouse is unclicked it goes back to the original color white.
and it does as many times as you click on the object.
However, what i want is a mouse click to work just once. so after the
second, third or more click OnMouseDown() and OnMouseUp() should not be called.
What can i do to solve my problem? A googled a lot and looked up many answers but non of them answered this question specifically.
Any help/advise will be much appreciated.
code is given below