Currently, we handle Keyboard input as follows:
void ProcessKey(KeyCode k)
{
if (k == KeyCode.Q)
{
// Do stuff
}
if (k == KeyCode.W)
{
// Do stuff
}
if (k == KeyCode.E)
{
// Do stuff
}
if (k == KeyCode.R)
{
// Do stuff
}
// ...
}
Is there a smarter way of doing this? It seems like this method will get very long and unmanageable.
I realize I can separate different “Do Stuffs” into things like “HandleQ()”, “HandleW()”, “HandleE()” methods, and so forth, but even still I’m not totally satisfied.