Tasharen Entertainment Forum

Support => NGUI 3 Support => Topic started by: Evan MLB on January 04, 2017, 04:53:01 PM

Title: nGUI Daydream Controller Event Hooks for Scroll View
Post by: Evan MLB on January 04, 2017, 04:53:01 PM
Hey everyone,

I've been learning nGUI for the past 2 weeks and I've become very familiar with the structure.

Currently I am passing GVRController Button Press from the daydream controller by using a raycast from the controller cursor, once I found a valid UI object a command is passed to execute OnClick() via a custom class.

I wanted to implement the same sort of system with UIScrollView, I believe I have the High level understanding. (Mouse events are recognized by UI camera, Those events are passed to the nGUI elements affected, the events support touch,keyboard and controller) The Touchpad of a controller goes -1 - 1 left/right down/up.

Can I pass the OnPress(bool) Drag() commands from the daydream controller to the nGUI event system? Any help would be appreciated - I will be looking at this over the next day or so

~Evan
Title: Re: nGUI Daydream Controller Event Hooks for Scroll View
Post by: ArenMook on January 05, 2017, 09:54:44 AM
You shouldn't be sending out your own events. If you have a custom controller method, then do just that -- add a custom controller method to UICamera. All of UICamera's functionality is in delegates -- UICamera.GetKey and such. All of it can be overwritten. Your custom controller should basically be telling UICamera that there is an event, and UICamera will handle the rest.