I have a grid of gameobjects with colliders. Currently they all have unity's inbuilt void OnMouseDown function which gets called when the mouse clicks on a collider. This then executes some game logic on the gameobject.
I realise that I could instead use a seperate script to send a raycast when the player clicks and if it intersects with one of the afformentioned gameobjects I can execute the code that way.
Is one approach better than the other? Or behind the scenes is unity using the raycast method for void OnMouseDown anyway? (Or is there perhaps a non-performance reason why you'd use one approach rather than the other)