This file contains hidden or 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 Vector2 ToVector2(this float value) | |
| { | |
| value *= Mathf.Deg2Rad; | |
| return new Vector2(Mathf.Cos(value), Mathf.Sin(value)); | |
| } | |
| public static float ToFloat(this Vector2 vec) | |
| { | |
| return Mathf.Atan2(vec.y, vec.x) * Mathf.Rad2Deg; | |
| } |