Search Unity

  1. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

Debug.DrawArrow()

Discussion in 'Made With Unity' started by AnomalusUndrdog, Apr 16, 2011.

  1. AnomalusUndrdog

    AnomalusUndrdog

    Joined:
    Jul 3, 2009
    Posts:
    1,497
    Did you ever wish there was a Debug.DrawArrow()? I did. Now I made one and I'd like to share it with you guys.

    This is useful for showing debug of a direction.

    Visualizing head and camera rotation:




    Visualizing spawn points:




    Code (csharp):
    1.  
    2. using UnityEngine;
    3. using System.Collections;
    4.  
    5. public static class DrawArrow
    6. {
    7.     public static void ForGizmo(Vector3 pos, Vector3 direction, float arrowHeadLength = 0.25f, float arrowHeadAngle = 20.0f)
    8.     {
    9.         Gizmos.DrawRay(pos, direction);
    10.        
    11.         Vector3 right = Quaternion.LookRotation(direction) * Quaternion.Euler(0,180+arrowHeadAngle,0) * new Vector3(0,0,1);
    12.         Vector3 left = Quaternion.LookRotation(direction) * Quaternion.Euler(0,180-arrowHeadAngle,0) * new Vector3(0,0,1);
    13.         Gizmos.DrawRay(pos + direction, right * arrowHeadLength);
    14.         Gizmos.DrawRay(pos + direction, left * arrowHeadLength);
    15.     }
    16.  
    17.     public static void ForGizmo(Vector3 pos, Vector3 direction, Color color, float arrowHeadLength = 0.25f, float arrowHeadAngle = 20.0f)
    18.     {
    19.         Gizmos.color = color;
    20.         Gizmos.DrawRay(pos, direction);
    21.        
    22.         Vector3 right = Quaternion.LookRotation(direction) * Quaternion.Euler(0,180+arrowHeadAngle,0) * new Vector3(0,0,1);
    23.         Vector3 left = Quaternion.LookRotation(direction) * Quaternion.Euler(0,180-arrowHeadAngle,0) * new Vector3(0,0,1);
    24.         Gizmos.DrawRay(pos + direction, right * arrowHeadLength);
    25.         Gizmos.DrawRay(pos + direction, left * arrowHeadLength);
    26.     }
    27.  
    28.     public static void ForDebug(Vector3 pos, Vector3 direction, float arrowHeadLength = 0.25f, float arrowHeadAngle = 20.0f)
    29.     {
    30.         Debug.DrawRay(pos, direction);
    31.        
    32.         Vector3 right = Quaternion.LookRotation(direction) * Quaternion.Euler(0,180+arrowHeadAngle,0) * new Vector3(0,0,1);
    33.         Vector3 left = Quaternion.LookRotation(direction) * Quaternion.Euler(0,180-arrowHeadAngle,0) * new Vector3(0,0,1);
    34.         Debug.DrawRay(pos + direction, right * arrowHeadLength);
    35.         Debug.DrawRay(pos + direction, left * arrowHeadLength);
    36.     }
    37.     public static void ForDebug(Vector3 pos, Vector3 direction, Color color, float arrowHeadLength = 0.25f, float arrowHeadAngle = 20.0f)
    38.     {
    39.         Debug.DrawRay(pos, direction, color);
    40.        
    41.         Vector3 right = Quaternion.LookRotation(direction) * Quaternion.Euler(0,180+arrowHeadAngle,0) * new Vector3(0,0,1);
    42.         Vector3 left = Quaternion.LookRotation(direction) * Quaternion.Euler(0,180-arrowHeadAngle,0) * new Vector3(0,0,1);
    43.         Debug.DrawRay(pos + direction, right * arrowHeadLength, color);
    44.         Debug.DrawRay(pos + direction, left * arrowHeadLength, color);
    45.     }
    46. }
    47.  
    The code works very much like DrawRay(), at the very least, it requires a position and direction. To specify length, multiply a number to your direction vector.
     
  2. RichBosworth

    RichBosworth

    Joined:
    May 26, 2009
    Posts:
    325
    I think this forum needs a "Like" button.
     
    Extelen1, Mikael-H, Lobolopez and 4 others like this.
  3. Ippokratis

    Ippokratis

    Joined:
    Oct 13, 2008
    Posts:
    1,520
    Thanks, it is very useful.
     
  4. cupsster

    cupsster

    Joined:
    Apr 14, 2009
    Posts:
    363
    Thank You.
     
  5. zine92

    zine92

    Joined:
    Nov 13, 2010
    Posts:
    1,347
    Thanks very much. Trying it now.
     
  6. calebhc

    calebhc

    Joined:
    Feb 11, 2013
    Posts:
    12
    Works like a charm! Thanks
     
  7. ZJP

    ZJP

    Joined:
    Jan 22, 2010
    Posts:
    2,646
    Agree
     
    Deleted User likes this.
  8. john-essy

    john-essy

    Joined:
    Apr 17, 2011
    Posts:
    464
    Amazing Thankyou
     
  9. XiaoHong

    XiaoHong

    Joined:
    Jun 2, 2013
    Posts:
    2
    Very useful for debugging. Using this to show the speed of my units.
     
  10. Nikolay-Lezhnev

    Nikolay-Lezhnev

    Joined:
    Nov 8, 2012
    Posts:
    6
    Thank you for your script.
    Version with 4-rays arrow ends - useful for 2D:
    Code (csharp):
    1.  
    2. using UnityEngine;
    3. using System.Collections;
    4.  
    5. public static class DrawArrow
    6. {
    7.     public static void ForGizmo (Vector3 pos, Vector3 direction, float arrowHeadLength = 0.25f, float arrowHeadAngle = 20.0f)
    8.     {
    9.         Gizmos.DrawRay (pos, direction);
    10.         DrawArrowEnd(true, pos, direction, Gizmos.color, arrowHeadLength, arrowHeadAngle);
    11.     }
    12.  
    13.     public static void ForGizmo (Vector3 pos, Vector3 direction, Color color, float arrowHeadLength = 0.25f, float arrowHeadAngle = 20.0f)
    14.     {
    15.         Gizmos.DrawRay (pos, direction);
    16.         DrawArrowEnd(true, pos, direction, color, arrowHeadLength, arrowHeadAngle);
    17.     }
    18.  
    19.     public static void ForDebug (Vector3 pos, Vector3 direction, float arrowHeadLength = 0.25f, float arrowHeadAngle = 20.0f)
    20.     {
    21.         Debug.DrawRay (pos, direction);
    22.         DrawArrowEnd(false, pos, direction, Gizmos.color, arrowHeadLength, arrowHeadAngle);
    23.     }
    24.  
    25.     public static void ForDebug (Vector3 pos, Vector3 direction, Color color, float arrowHeadLength = 0.25f, float arrowHeadAngle = 20.0f)
    26.     {
    27.         Debug.DrawRay (pos, direction, color);
    28.         DrawArrowEnd(false, pos, direction, color, arrowHeadLength, arrowHeadAngle);
    29.     }
    30.    
    31.     private static void DrawArrowEnd (bool gizmos, Vector3 pos, Vector3 direction, Color color, float arrowHeadLength = 0.25f, float arrowHeadAngle = 20.0f)
    32.     {
    33.         Vector3 right = Quaternion.LookRotation (direction) * Quaternion.Euler (arrowHeadAngle, 0, 0) * Vector3.back;
    34.         Vector3 left = Quaternion.LookRotation (direction) * Quaternion.Euler (-arrowHeadAngle, 0, 0) * Vector3.back;
    35.         Vector3 up = Quaternion.LookRotation (direction) * Quaternion.Euler (0, arrowHeadAngle, 0) * Vector3.back;
    36.         Vector3 down = Quaternion.LookRotation (direction) * Quaternion.Euler (0, -arrowHeadAngle, 0) * Vector3.back;
    37.         if (gizmos) {
    38.             Gizmos.color = color;
    39.             Gizmos.DrawRay (pos + direction, right * arrowHeadLength);
    40.             Gizmos.DrawRay (pos + direction, left * arrowHeadLength);
    41.             Gizmos.DrawRay (pos + direction, up * arrowHeadLength);
    42.             Gizmos.DrawRay (pos + direction, down * arrowHeadLength);
    43.         } else {
    44.             Debug.DrawRay (pos + direction, right * arrowHeadLength, color);
    45.             Debug.DrawRay (pos + direction, left * arrowHeadLength, color);
    46.             Debug.DrawRay (pos + direction, up * arrowHeadLength, color);
    47.             Debug.DrawRay (pos + direction, down * arrowHeadLength, color);
    48.         }
    49.     }
    50. }
    51.  
    $test.png
     
  11. ocimum

    ocimum

    Joined:
    Apr 19, 2015
    Posts:
    12
    Thanks, works great!
     
  12. Bomadeno

    Bomadeno

    Joined:
    Jul 9, 2012
    Posts:
    2
    Sometimes you don't want arrows on the end of the line, you want them 50 % (or any %) along the line. If so, this modification lets you do that:

    Code (CSharp):
    1. using UnityEngine;
    2.  
    3. /// <summary>
    4. /// Based on  https://forum.unity3d.com/threads/debug-drawarrow.85980/
    5. /// </summary>
    6. public static class DrawArrow
    7. {
    8.     public static void ForGizmo(Vector3 pos, Vector3 direction, float arrowHeadLength = 0.25f, float arrowHeadAngle = 20.0f, float arrowPosition = 0.5f)
    9.     {
    10.         ForGizmo(pos, direction, Gizmos.color, arrowHeadLength, arrowHeadAngle, arrowPosition);
    11.     }
    12.  
    13.     public static void ForGizmo(Vector3 pos, Vector3 direction, Color color, float arrowHeadLength = 0.25f, float arrowHeadAngle = 20.0f, float arrowPosition = 0.5f)
    14.     {
    15.         Gizmos.color = color;
    16.         Gizmos.DrawRay(pos, direction);
    17.         DrawArrowEnd(true, pos, direction, color, arrowHeadLength, arrowHeadAngle, arrowPosition);
    18.     }
    19.  
    20.     public static void ForDebug(Vector3 pos, Vector3 direction, float arrowHeadLength = 0.25f, float arrowHeadAngle = 20.0f, float arrowPosition = 0.5f)
    21.     {
    22.         ForDebug(pos, direction, Color.white, arrowHeadLength, arrowHeadAngle, arrowPosition);
    23.     }
    24.  
    25.     public static void ForDebug(Vector3 pos, Vector3 direction, Color color, float arrowHeadLength = 0.25f, float arrowHeadAngle = 20.0f, float arrowPosition = 0.5f)
    26.     {
    27.         Debug.DrawRay(pos, direction, color);
    28.         DrawArrowEnd(false, pos, direction, color, arrowHeadLength, arrowHeadAngle, arrowPosition);
    29.     }
    30.     private static void DrawArrowEnd(bool gizmos, Vector3 pos, Vector3 direction, Color color, float arrowHeadLength = 0.25f, float arrowHeadAngle = 20.0f, float arrowPosition = 0.5f)
    31.     {
    32.         Vector3 right = (Quaternion.LookRotation(direction) * Quaternion.Euler(arrowHeadAngle, 0, 0) * Vector3.back) * arrowHeadLength;
    33.         Vector3 left = (Quaternion.LookRotation(direction) * Quaternion.Euler(-arrowHeadAngle, 0, 0) * Vector3.back) * arrowHeadLength;
    34.         Vector3 up = (Quaternion.LookRotation(direction) * Quaternion.Euler(0, arrowHeadAngle, 0) * Vector3.back) * arrowHeadLength;
    35.         Vector3 down = (Quaternion.LookRotation(direction) * Quaternion.Euler(0, -arrowHeadAngle, 0) * Vector3.back) * arrowHeadLength;
    36.  
    37.         Vector3 arrowTip = pos + (direction*arrowPosition);
    38.  
    39.         if (gizmos)
    40.         {
    41.             Gizmos.color = color;
    42.             Gizmos.DrawRay(arrowTip, right);
    43.             Gizmos.DrawRay(arrowTip, left);
    44.             Gizmos.DrawRay(arrowTip, up);
    45.             Gizmos.DrawRay(arrowTip, down);
    46.         }
    47.         else {
    48.             Debug.DrawRay(arrowTip, right, color);
    49.             Debug.DrawRay(arrowTip, left, color);
    50.             Debug.DrawRay(arrowTip, up, color);
    51.             Debug.DrawRay(arrowTip, down, color);
    52.         }
    53.     }
    54. }
    55.  
     
  13. conceptfac

    conceptfac

    Joined:
    Feb 15, 2018
    Posts:
    21
    error CS0103: The name `DrawArrow' does not exist in the current context
     
  14. VRARDAJ

    VRARDAJ

    Joined:
    Jul 25, 2017
    Posts:
    17
    This is great work! I've added to it a bit. I wanted to encapsulate everything OnDrawGizmos within this one class so that other classes can use all drawable capabilities (including handles) without having to implement OnDrawGizmos.

    I needed to utilize a singleton pattern instead of static. Rather than call DrawArrow from anywhere, I add it to an empty object in-scene and let everyone call its singleton instance (see http://wiki.unity3d.com/index.php/Singleton).

    This way, DrawArrow can call OnDrawGizmos. To manage rerendering, I created a dictionary of lines to be drawn. Memory allocation is heavier this way, but I figure I only need this for a few lines at a time.

    With this in place, labels to display arrow magnitude are much easier.

    Code (CSharp):
    1. using UnityEngine;
    2. using System.Collections;
    3. using UnityEditor;
    4. using System.Collections.Generic;
    5.  
    6. public class DrawArrow : Singleton<DrawArrow>
    7. {
    8.     Dictionary<string, DebugLineData> linesToDraw;
    9.     List<string> keysToUpdate;
    10.  
    11.     private void Awake()
    12.     {
    13.         linesToDraw = new Dictionary<string, DebugLineData>();
    14.         keysToUpdate = new List<string>();
    15.     }
    16.  
    17.     public void ForGizmo(Vector3 pos, Vector3 direction, float arrowHeadLength = 0.25f, float arrowHeadAngle = 20.0f)
    18.     {
    19.         Gizmos.DrawRay(pos, direction);
    20.  
    21.         Vector3 right = Quaternion.LookRotation(direction) * Quaternion.Euler(0, 180 + arrowHeadAngle, 0) * new Vector3(0, 0, 1);
    22.         Vector3 left = Quaternion.LookRotation(direction) * Quaternion.Euler(0, 180 - arrowHeadAngle, 0) * new Vector3(0, 0, 1);
    23.         Gizmos.DrawRay(pos + direction, right * arrowHeadLength);
    24.         Gizmos.DrawRay(pos + direction, left * arrowHeadLength);
    25.     }
    26.  
    27.     public void ForGizmo(Vector3 pos, Vector3 direction, Color color, float arrowHeadLength = 0.25f, float arrowHeadAngle = 20.0f)
    28.     {
    29.         Gizmos.color = color;
    30.         Gizmos.DrawRay(pos, direction);
    31.  
    32.         Vector3 right = Quaternion.LookRotation(direction) * Quaternion.Euler(0, 180 + arrowHeadAngle, 0) * new Vector3(0, 0, 1);
    33.         Vector3 left = Quaternion.LookRotation(direction) * Quaternion.Euler(0, 180 - arrowHeadAngle, 0) * new Vector3(0, 0, 1);
    34.         Gizmos.DrawRay(pos + direction, right * arrowHeadLength);
    35.         Gizmos.DrawRay(pos + direction, left * arrowHeadLength);
    36.     }
    37.  
    38.     public void ForGizmoWithMagnitude(string key, Vector3 pos, Vector3 direction, Color color, float arrowHeadLength = 0.25f, float arrowHeadAngle = 20.0f)
    39.     {
    40.         DebugLineData lineData = new DebugLineData();
    41.         lineData.drawing = true;
    42.         lineData.pos = pos;
    43.         lineData.direction = direction;
    44.         lineData.color = color;
    45.         lineData.arrowHeadLength = arrowHeadLength;
    46.         lineData.arrowHeadAngle = arrowHeadAngle;
    47.  
    48.         if (!linesToDraw.ContainsKey(key))
    49.             linesToDraw.Add(key, lineData);
    50.         else linesToDraw[key] = lineData;
    51.     }
    52.  
    53.     private void ForGizmoWithMagnitudeInternal(DebugLineData lineData)
    54.     {
    55.         Gizmos.color = lineData.color;
    56.         Gizmos.DrawRay(lineData.pos, lineData.direction);
    57.  
    58.         Vector3 right = Quaternion.LookRotation(lineData.direction) * Quaternion.Euler(0, 180 + lineData.arrowHeadAngle, 0) * new Vector3(0, 0, 1);
    59.         Vector3 left = Quaternion.LookRotation(lineData.direction) * Quaternion.Euler(0, 180 - lineData.arrowHeadAngle, 0) * new Vector3(0, 0, 1);
    60.         Gizmos.DrawRay(lineData.pos + lineData.direction, right * lineData.arrowHeadLength);
    61.         Gizmos.DrawRay(lineData.pos + lineData.direction, left * lineData.arrowHeadLength);
    62.         Vector3 midPoint = lineData.pos + 0.5f * lineData.direction + new Vector3(0, 0.1f, 0);
    63.         string magnitude = lineData.direction.magnitude.ToString();
    64.         Handles.Label(midPoint, magnitude);
    65.     }
    66.  
    67.     public void ForDebug(Vector3 pos, Vector3 direction, float arrowHeadLength = 0.25f, float arrowHeadAngle = 20.0f)
    68.     {
    69.         Debug.DrawRay(pos, direction);
    70.  
    71.         Vector3 right = Quaternion.LookRotation(direction) * Quaternion.Euler(0, 180 + arrowHeadAngle, 0) * new Vector3(0, 0, 1);
    72.         Vector3 left = Quaternion.LookRotation(direction) * Quaternion.Euler(0, 180 - arrowHeadAngle, 0) * new Vector3(0, 0, 1);
    73.         Debug.DrawRay(pos + direction, right * arrowHeadLength);
    74.         Debug.DrawRay(pos + direction, left * arrowHeadLength);
    75.     }
    76.     public void ForDebug(Vector3 pos, Vector3 direction, Color color, float arrowHeadLength = 0.25f, float arrowHeadAngle = 20.0f)
    77.     {
    78.         Debug.DrawRay(pos, direction, color);
    79.  
    80.         Vector3 right = Quaternion.LookRotation(direction) * Quaternion.Euler(0, 180 + arrowHeadAngle, 0) * new Vector3(0, 0, 1);
    81.         Vector3 left = Quaternion.LookRotation(direction) * Quaternion.Euler(0, 180 - arrowHeadAngle, 0) * new Vector3(0, 0, 1);
    82.         Debug.DrawRay(pos + direction, right * arrowHeadLength, color);
    83.         Debug.DrawRay(pos + direction, left * arrowHeadLength, color);
    84.     }
    85.  
    86.  
    87.     private void OnDrawGizmos()
    88.     {
    89.         if (linesToDraw != null && linesToDraw.Count > 0)
    90.         {
    91.             foreach (KeyValuePair<string, DebugLineData> lineDataPair in linesToDraw)
    92.                 if (lineDataPair.Value.drawing)
    93.                 {
    94.                     ForGizmoWithMagnitudeInternal(lineDataPair.Value);
    95.                     keysToUpdate.Add(lineDataPair.Key);
    96.                 }
    97.  
    98.             for (int i = 0; i < keysToUpdate.Count; i++)
    99.             {
    100.                 DebugLineData lineData = linesToDraw[keysToUpdate[i]];
    101.                 lineData.drawing = false;
    102.                 linesToDraw[keysToUpdate[i]] = lineData;
    103.             }
    104.  
    105.             if (keysToUpdate.Count > 0)
    106.                 keysToUpdate.Clear();
    107.         }
    108.     }
    109. }
    110.  
    111. public struct DebugLineData
    112. {
    113.     public bool drawing;
    114.     public Vector3 pos;
    115.     public Vector3 direction;
    116.     public Color color;
    117.     public float arrowHeadLength;
    118.     public float arrowHeadAngle;
    119. }
    120.  
     
  15. methusalah999

    methusalah999

    Joined:
    May 22, 2017
    Posts:
    392
    You will find all built-in gizmos, written in the Debug.DrawLine style in the DebugPlus asset, currently in beta.

    See here !
     
  16. viruseg

    viruseg

    Joined:
    Jul 8, 2017
    Posts:
    5
    Added Handles support
    Code (CSharp):
    1. using UnityEditor;
    2. using UnityEngine;
    3.  
    4. public static class DrawArrow
    5. {
    6.     public static void ForHandle(in Vector3 pos, in Vector3 direction, float arrowHeadLength = 0.25f, float arrowHeadAngle = 20.0f)
    7.     {
    8.         Arrow(TargetType.Handle, pos, direction, Handles.color, arrowHeadLength, arrowHeadAngle);
    9.     }
    10.  
    11.     public static void ForHandle(in Vector3 pos, in Vector3 direction, in Color color, float arrowHeadLength = 0.25f, float arrowHeadAngle = 20.0f)
    12.     {
    13.         Arrow(TargetType.Handle, pos, direction, color, arrowHeadLength, arrowHeadAngle);
    14.     }
    15.    
    16.     public static void ForGizmo(in Vector3 pos, in Vector3 direction, float arrowHeadLength = 0.25f, float arrowHeadAngle = 20.0f)
    17.     {
    18.         Arrow(TargetType.Gizmo, pos, direction, Gizmos.color, arrowHeadLength, arrowHeadAngle);
    19.     }
    20.  
    21.     public static void ForGizmo(in Vector3 pos, in Vector3 direction, in Color color, float arrowHeadLength = 0.25f, float arrowHeadAngle = 20.0f)
    22.     {
    23.         Arrow(TargetType.Gizmo, pos, direction, color, arrowHeadLength, arrowHeadAngle);
    24.     }
    25.  
    26.     public static void ForDebug(in Vector3 pos, in Vector3 direction, float arrowHeadLength = 0.25f, float arrowHeadAngle = 20.0f)
    27.     {
    28.         Debug.DrawRay(pos, direction);
    29.         Arrow(TargetType.Debug, pos, direction, Gizmos.color, arrowHeadLength, arrowHeadAngle);
    30.     }
    31.  
    32.     public static void ForDebug(in Vector3 pos, in Vector3 direction, in Color color, float arrowHeadLength = 0.25f, float arrowHeadAngle = 20.0f)
    33.     {
    34.         Debug.DrawRay(pos, direction, color);
    35.         Arrow(TargetType.Debug, pos, direction, color, arrowHeadLength, arrowHeadAngle);
    36.     }
    37.  
    38.     private static void Arrow(TargetType targetType, in Vector3 pos, in Vector3 direction, in Color color, float arrowHeadLength = 0.25f, float arrowHeadAngle = 20.0f)
    39.     {
    40.         var right = Quaternion.LookRotation(direction) * Quaternion.Euler(arrowHeadAngle, 0, 0) * Vector3.back * arrowHeadLength;
    41.         var left  = Quaternion.LookRotation(direction) * Quaternion.Euler(-arrowHeadAngle, 0, 0) * Vector3.back * arrowHeadLength;
    42.         var up    = Quaternion.LookRotation(direction) * Quaternion.Euler(0, arrowHeadAngle, 0) * Vector3.back * arrowHeadLength;
    43.         var down  = Quaternion.LookRotation(direction) * Quaternion.Euler(0, -arrowHeadAngle, 0) * Vector3.back * arrowHeadLength;
    44.         var end   = pos + direction;
    45.         Color colorPrew;
    46.        
    47.         switch (targetType)
    48.         {
    49.             case TargetType.Gizmo:
    50.                 colorPrew = Gizmos.color;
    51.                 Gizmos.color = color;
    52.                 Gizmos.DrawRay(pos, direction);
    53.                 Gizmos.DrawRay(end, right);
    54.                 Gizmos.DrawRay(end, left);
    55.                 Gizmos.DrawRay(end, up);
    56.                 Gizmos.DrawRay(end, down);
    57.                 Gizmos.color = colorPrew;
    58.                 break;
    59.            
    60.             case TargetType.Debug:
    61.                 Debug.DrawRay(end, right, color);
    62.                 Debug.DrawRay(end, left, color);
    63.                 Debug.DrawRay(end, up, color);
    64.                 Debug.DrawRay(end, down, color);
    65.                 break;
    66.            
    67.             case TargetType.Handle:
    68.                 colorPrew = Handles.color;
    69.                 Handles.color = color;
    70.                 Handles.DrawLine(pos, end);
    71.                 Handles.DrawLine(end, end + right);
    72.                 Handles.DrawLine(end, end + left);
    73.                 Handles.DrawLine(end, end + up);
    74.                 Handles.DrawLine(end, end + down);
    75.                 Handles.color = colorPrew;
    76.                 break;
    77.         }
    78.     }
    79.    
    80.     private enum TargetType
    81.     {
    82.         Gizmo, Debug, Handle
    83.     }
    84. }
    85.  
     
    Last edited: Aug 30, 2020
  17. illinar

    illinar

    Joined:
    Apr 6, 2011
    Posts:
    748
    It's 2020, please add this feature to Unity.
    Gizmos.DrawArrow()
    Debug.DrawArrow()
    !!!
     
unityunity