vdkuipb
6/26/2018 - 6:29 AM

refactor.cs

float dx = Input.GetAxis("Horizontal");
float dy = Input.GetAxis("Vertical");

direction = new Vector3(dx, dy, 0);

/*
if (Input.GetButton(inputUp))
{
    direction.y = 1;
}
else if (Input.GetButton(inputDown))
{
    direction.y = -1;
}
else
{
    direction.y = 0;
}

if (Input.GetButton(inputForward))
{
    direction.x = 1;
}
else if (Input.GetButton(inputBack))
{
    direction.x = -1;
}
else
{
    direction.x = 0;
}

if (Input.GetButton(inputUp))
{
    direction.z = 1;
}
else if (Input.GetButton(inputDown))
{
    direction.z = -1;
}
else
{
    direction.z = 0;
}
*/