Example #1
0
        public static void FatArrow(Vector3 pos, Vector3 direction, float width = 1f)
        {
            Vector3 arrowWidth  = direction.normalized * width;
            Vector3 arrowLength = direction - arrowWidth;

            Handles.DrawLine(pos, pos + arrowLength);

            Vector3 trunkDirection = Vector2Helpers.Rotate(arrowWidth, 90);

            Handles.DrawLine(pos, pos + trunkDirection);
            Handles.DrawLine(pos + trunkDirection, pos + trunkDirection + arrowLength);

            Vector3 arrowBottomWing = Vector2Helpers.Rotate(arrowWidth / 2, -90);

            Handles.DrawLine(pos + arrowLength, pos + arrowLength + arrowBottomWing);

            Vector3 arrowTopWing = trunkDirection / 2;

            Handles.DrawLine(pos + trunkDirection + arrowLength, pos + trunkDirection + arrowLength + arrowTopWing);

            Vector3 arrowEnd = pos + (trunkDirection / 2) + arrowLength + arrowWidth;

            Handles.DrawLine(pos + arrowLength + arrowBottomWing, arrowEnd);
            Handles.DrawLine(pos + trunkDirection + arrowLength + arrowTopWing, arrowEnd);
        }
Example #2
0
        public static void Arrow(Vector3 pos, Vector3 direction, float width = 1f)
        {
            Vector3 arrowTip = pos + direction;

            Handles.DrawLine(pos, arrowTip);
            Handles.DrawLine(arrowTip, arrowTip + (Vector3)Vector2Helpers.Rotate(-direction.normalized * width, 45));
            Handles.DrawLine(arrowTip, arrowTip + (Vector3)Vector2Helpers.Rotate(-direction.normalized * width, -45));
        }