Last active
October 24, 2017 05:08
-
-
Save mikenekoworks/532002b5d5021a806e69d15acaa1a929 to your computer and use it in GitHub Desktop.
Gizmoで円弧を書く。
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 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