void Update()
{
if (Input.GetKeyDown(KeyCode.LeftArrow))
{
_caveManDude.faceBackwards();
_caveManDude.startAnimation("walk");
}
if (Input.GetKeyDown(KeyCode.RightArrow))
{
_caveManDude.faceForwards();
_caveManDude.startAnimation("walk");
}
if (Input.GetKeyUp(KeyCode.RightArrow) || Input.GetKeyUp(KeyCode.LeftArrow))
{
if (_caveManDude.currentAnimation != null)
{
_caveManDude.currentAnimation.stop();
}
}
if (Input.GetKeyDown(KeyCode.Space))
{
_caveManDude.startAnimation("hit");
}
}