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