Trigger events on world UI elements in the correct order. (#3482)
Trigger events on world UI elements in the correct order. (#3482)

* Trigger events on world UI elements in the correct order.

* Refactor ray checking logic to improve clarity.

* Remove useless 'result' variable on _checkElement.
MicroWorldwide/PlayCanvas,MicroWorldwide/PlayCanvas,playcanvas/engine,playcanvas/engine