How to draw the 2D blue dot as used in the editor.

I’m writing several editor extensions for the 2D part of unity and can’t figure out how to draw the little blue dot handles used with sprites.

[20983-blue+dot.png|20983]

[CustomEditor(typeof(HingeJoint2D))]

[CustomEditor(typeof(HingeJoint2D))]
public class HingeJoint2DEditor : Editor 
{
    void OnDrawGizmos()
    {
		var t = target as HingeJoint2D;
		var aV = new Vector3(t.anchor.x, t.anchor.y);
		aV = t.gameObject.transform.TransformPoint(aV);
		Gizmos.DrawIcon(aV, "point.png", false);
		Debug.Log(aV);
    }
    
    void OnSceneGUI()
    {
		var t = target as HingeJoint2D;
		var aV = new Vector3(t.anchor.x, t.anchor.y);
		aV = t.gameObject.transform.TransformPoint(aV);
		Gizmos.DrawIcon(aV, "point.png", false);
		Debug.Log(aV);
    }
}

I’ve tried this in both OnSceneGUI and OnDrawGizmos and OnScene gets called and ran but throws an exception stating that Gizmos.DrawIcon can only be called from OnDrawGizmos.

OnDrawGizmos never gets called in this instance do to the fact it’s editor extension.

I do want the functionality of Gizmos.DrawIcon. It just won’t work with an editor extension.

Hello! Try using Gizmos.DrawIcon with either your own icon or cut one out of that image.