Hi, I was wondering if there was a simple way to execute a function ONCE when a button has been focused on?
I threw this on to the Update function just to see if it would work, and it did:
es = event system reference
btnA = the button being focused on
if (es.currentSelectedGameObject == btnA.gameObject) {
btnA.transform.localScale += new Vector3(0.1F, 0.1F, 0);
}
But I am unsure how to make it execute only ONCE when a button has been focused on, without adding an enlarged boolean for every single button I have - there are a few. I was hoping there was just a function like “onFocus” or something, but I can’t seem to find it. Any ideas?