Reputation: 1
public void application() // function when the mouse only find the ui canvas button
{
// when the mouse find only canvas button and when clicked then do something else stop
if (Input.GetButton("Fire1"))
{
print("button pressed");
}
else {
print("button released");
}
}
Upvotes: 0
Views: 200
Reputation: 10701
When dealing with the UI system, you should use the IPointerXXXX interfaces:
public class MyClass: MonoBehaviour, IPointerUpHandler{
public void OnPointerUp(PointerEventData eventData)
{
throw new NotImplementedException();
}
}
Upvotes: 1