unity3d - How do you reference UI Event System from script? -


i tried creating public variable , referencing eventsystem object inspector of gameobject script attached to, whenever try access variable eventsystems,

i nullreference exception: object reference not set instance of object.

i tried finding gameobject.find() apparently can't cast gameobject eventsystem.eventsystem in-built cast.

i'm not sure do. want access

eventsystem.currentselectedgameobject.name

to find out ui object in canvas selected.

here want, see documentation here.

eventsystem.current 

enter image description here


Comments

Popular posts from this blog

twig - Using Twigbridge in a Laravel 5.1 Package -

jdbc - Not able to establish database connection in eclipse -

firemonkey - How do I make a beep sound in Android using Delphi and the API? -