コード例 #1
0
ファイル: DebugPlus.cs プロジェクト: bdjewkes/trollplayer
        public static void DrawCapsule(Vector2 start, float radius, Vector2 dir, Color color, int numSegments = 20, float time = 0) {
            var angle = dir.Angle2D();
            DrawArc(start, radius, angle + 90, angle + 270, color, numSegments, time);
            DrawArc(start + dir, radius, angle + 90, angle - 90, color, numSegments, time);

            var leftDisplacement = dir.Left2D().normalized * radius;
            Debug.DrawLine(start + leftDisplacement, start + dir + leftDisplacement, color, time);
            Debug.DrawLine(start - leftDisplacement, start + dir - leftDisplacement, color, time);
        }