EEditorGUILayout.ObjectField Texture2D vs Sprite probem

Trying to assign sprite field in EditorGUILayout. EditorGUILayout.ObjectField only accepts Texture2D, but I need to assign a sprite to an (UI)Image.sprite. Having a problem searching this because I’m not sure of how to word it.

Basically I need this:

field.Icon = (Texture2D) EditorGUILayout.ObjectField (“Icon”, field.Icon, typeof(Texture2D), true);

but for Sprite, if you get where I’m coming from.

try using
field.icon = (Sprite)EditorGUILayout.ObjectField (“Icon”, field.Icon, typeof(Sprite), true);