Esempio n. 1
0
        public static void DrawEnd(Transform transform, Vector3 center, float radius, float endInSet = 0.6f)
        {
            int segments = 10;

            for (int i = 0; i < segments; i++)
            {
                var angle  = Mathf.PI * 2 * i / segments;
                var radial = new Vector3(radius * Mathf.Sin(angle), radius * Mathf.Cos(angle), 0);
                HandleExtention.DrawLine(transform, center + Vector3.forward * radius * endInSet, center + radial);
            }
        }
Esempio n. 2
0
        public static void DrawColumn(Transform transform, Vector3 center, float radius, float thickness)
        {
            int segments = 10;
            var offset   = Vector3.forward * thickness / 2;

            HandleExtention.DrawWireDisc(transform, center - offset, Vector3.forward, radius);
            HandleExtention.DrawWireDisc(transform, center + offset, Vector3.forward, radius);
            for (int i = 0; i < segments; i++)
            {
                var angle  = Mathf.PI * 2 * i / segments;
                var radial = new Vector3(radius * Mathf.Sin(angle), radius * Mathf.Cos(angle), 0);
                HandleExtention.DrawLine(transform, center + radial + offset, center + radial - offset);
            }
        }
Esempio n. 3
0
 private static void DrawLineWithOffset(Transform transform, Vector3 p1, Vector3 p2, Vector3 offset)
 {
     HandleExtention.DrawLine(transform, p1 + offset, p2 + offset);
 }