Hi,
I have a basic menu setup and works fine but I want the focus of the first button to be highlighted without hovering over with the mouse, i read that this can be done with event system but seems to be c#, can i do this with unityscript.
Thanks
Hi,
I have a basic menu setup and works fine but I want the focus of the first button to be highlighted without hovering over with the mouse, i read that this can be done with event system but seems to be c#, can i do this with unityscript.
Thanks
I’m sure you can. But there is a field in the EventSystems component that says ‘Selected’ so you can try that.
thanks, used the below and worked well.
import UnityEngine.UI;
import UnityEngine.EventSystems;
var firstbutton_options : Button;
var ev : EventSystem; //get event system
ev.SetSelectedGameObject(firstbutton_options.gameObject);