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

gcc - MinGW's ld cannot perform PE operations on non PE output file -

timeout - Handshake_timeout on RabbitMQ using python and pika from remote vm -

c# - Search and Add Comment with OpenXML for Word -