tanuva / planegame

Fly a small plane with arcady flight physics (done) and deliver stuff (not done yet). Clone of a hobbyist game I loved years ago.
MIT License
0 stars 0 forks source link

Use Unity messaging for input #2

Open tanuva opened 9 years ago

tanuva commented 9 years ago

One input behavior script should broadcast messages on input. The Unity examples handle their input themselves through tight coupling which is not too flexible.

tanuva commented 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.