Event Triggers

From ETC Public Wiki
Jump to: navigation, search

It is really easy to use events with the Daydream. You'd have to use the Event Trigger script which is basically an extension of Unity's Event Trigger script that comes with the GoogleVR package. Simply add it to a game object with a collider and then add appropriate events as you see fit.

It cannot be multiple-edited, though, unlike Unity's Event Trigger script. So keep that in mind when you're using this.

Types of events available:

1. PointerEnter

2. PointerExit

3. PointerClick

4. PointerDown

5. PointerUp

6. Drag

7. Drop

8. Scroll

9. UpdateSelected

10. Select

11. Deselect

12. Move

13. InitializePotentialDrag

14. BeginDrag

15. EndDrag

16. Submit

17. Cancel



You can also make your own class to handle these events. All you have to do to do that is to implement the I(EventName)Handler interface. For instance,

         public class ClickHandler : MonoBehaviour, IPointerClickHandler
         {
            
                void OnPointerClick(PointerEventData eventData) 
                { 
                     
                  // do stuff 
                     
                }
              
         }