Skip to content

Instantly share code, notes, and snippets.

@mikenekoworks
Last active October 24, 2017 05:08
Show Gist options
  • Save mikenekoworks/532002b5d5021a806e69d15acaa1a929 to your computer and use it in GitHub Desktop.
Save mikenekoworks/532002b5d5021a806e69d15acaa1a929 to your computer and use it in GitHub Desktop.
Gizmoで円弧を書く。
public static void DrawGizmoArc( Vector3 p, Vector3 up, Vector3 forward, float angle, float radius ) {
#if UNITY_EDITOR
var oldColor = UnityEditor.Handles.color;
UnityEditor.Handles.color = Color.red;
UnityEditor.Handles.DrawWireArc( p, up, Quaternion.AngleAxis( -angle * 0.5f, up ) * forward, angle, radius );
UnityEditor.Handles.DrawLine( p, p + Quaternion.AngleAxis( -angle * 0.5f, up ) * forward * radius );
UnityEditor.Handles.DrawLine( p, p + Quaternion.AngleAxis( angle * 0.5f, up ) * forward * radius );
UnityEditor.Handles.color = oldColor;
#endif
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment