Basically what I need is an idea how to shorten my code.
So what I have now is an IF series to get the keys that user presses:
if (Input.GetKeyDown(KeyCode.I))
{
AddToBuffer("I");
}
else if (Input.GetKeyDown(KeyCode.N))
{
AddToBuffer("N");
}
else if (Input.GetKeyDown(KeyCode.F))
{
AddToBuffer("F");
}
It works perfectly well, but what I want is to shorten it so it would be possible to save to buffer any key (better, as a string)
So that I would no more have to specify what key was pressed.
(Maybe something like TryParse etc.)