public void Setup(Vector2 moveDirection) { this.moveDir = moveDirection; float angle = RotaionalUtilities.GetAngleFromVector(moveDir); this.transform.rotation = Quaternion.Euler(0, 0, angle); }
public static float GetAngleBetweenTwoVectors(Vector2 a, Vector2 b) { Vector2 direction = b - a; return(RotaionalUtilities.GetAngleFromVector(direction.normalized)); }