Created
May 12, 2020 02:38
-
-
Save DataGreed/a84b295ade22a6d2a1b4296dcf9ff01e to your computer and use it in GitHub Desktop.
rotate Vector2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static class Vector2Extension | |
{ | |
public static Vector2 Rotate(this Vector2 v, float degrees) | |
{ | |
return Quaternion.Euler(0, 0, degrees) * v; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment