Skip to content

Instantly share code, notes, and snippets.

View hwibaek's full-sized avatar

hwibaek hwibaek

  • 한국
  • 05:02 (UTC +09:00)
View GitHub Profile
@hwibaek
hwibaek / Utils.cs
Created May 4, 2025 05:27
Util methods for my Unity projects
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;
}