예제 #1
0
    public void Setup(Vector2 moveDirection)
    {
        this.moveDir = moveDirection;
        float angle = RotaionalUtilities.GetAngleFromVector(moveDir);

        this.transform.rotation = Quaternion.Euler(0, 0, angle);
    }
예제 #2
0
    public static float GetAngleBetweenTwoVectors(Vector2 a, Vector2 b)
    {
        Vector2 direction = b - a;

        return(RotaionalUtilities.GetAngleFromVector(direction.normalized));
    }