Most Unity tutorials suggest using mouse events in the update function, for example:
function Update () {
if (UnityEngine.Input.GetMouseButton(1)) {
}
}
This seems really inefficient to me, although it seems like using onEnterFrame in AS or setInterval in JS to power the whole application - I would rather use an event-based system.
The OnMouseDown () method is useful, but it is only triggered if MouseDown is on the object, and not somewhere in the scene.
So here is the question: is there a MouseEvent in Unity to detect if the mouse button is disabled globally, or is this an upgrade solution recommended?
source
share