unity face direction of movement

C#
transform.rotation = Quaternion.LookRotation(dir);
Source

Also in C#: