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");
}
}
答案 0 :(得分:1)
在处理UI系统时,您应该使用IPointerXXXX接口:
public class MyClass: MonoBehaviour, IPointerUpHandler{
public void OnPointerUp(PointerEventData eventData)
{
throw new NotImplementedException();
}
}