button deselect unity code example
Example: how to deselect a button through code unity
GameObject myEventSystem = GameObject.Find("EventSystem");
myEventSystem .GetComponent<UnityEngine.EventSystems.EventSystem>().SetSelectedGameObject(null);
GameObject myEventSystem = GameObject.Find("EventSystem");
myEventSystem .GetComponent<UnityEngine.EventSystems.EventSystem>().SetSelectedGameObject(null);