Is an object selected?

I am looking at the documentation for Selectable UI objects, and I can’t find a simple property or function that will tell me if the object is currently selected.

IsHighlighted() seems to be the closest thing, but the documentation says this takes eventData as a parameter.

I’m probably missing something really obvious. Anyone know?

http://docs.unity3d.com/ScriptReference/UI.Selectable.html

I believe ( someone can confirm? ) EventSystem.current.currentSelectedGameObject is what I want.

1 Like