clickable arrow/transition like in Mecanim/AnimatorController window

As i said i need arrow which i can select and can be mulitple transition (three arrow) like in AnimatorController window. Its use texture/guistyle and GUI.toggle with rotated rect? if yes they are exposed in unity gui editor API ?(e.g. new GUIStyle(“name_for_arrow”) ) or use GL class or another solution? Could you help me with this?

i made small research with inspector for editor guistyles for me but no luck ;/

thanks in advance

To my knowledge there’s nothing in the editor API, so you’ll have to use GL. See this link for a tutorial on drawing triangles.

To tell if the user has clicked on the arrow line, check if Event.current.mousePosition is on the line defined by the endpoints of the arrow +/- a certain tolerance, maybe 4-6 pixels or so.

AnimatorController just uses the GL class. The arrow heads are just triangles and the edges seem to be drawn using (undocumented) Handles.DrawAAPolyLine.

1 Like

Drawing lines using Handles.DrawBezier works well enough for me. Having the lines clickable… that might be another story. I don’t really know how I’d do that.