Open tanuva opened 9 years ago
Broadcasting messages to all objects is not possible in Unity and probably not the way to do it. Currently, all objects that want input query the InputHandler themselves. That seems quite reasonable.
That InputHandler sits on the Player GO though. Probably it should rather be on the (to-be) GameManager God-object that can be retrieved through GameObject.find
from everywhere.
One input behavior script should broadcast messages on input. The Unity examples handle their input themselves through tight coupling which is not too flexible.