Closed stbertou closed 8 years ago
Pretty simple as you can see!
public class OnGazeEnterEvent : MonoBehaviour
{
public UnityEvent Event;
public void OnGazeEnter()
{
if (Event != null)
{
Event.Invoke();
}
}
}
I've prototyped, it works well and you can litterally do "anything" as you can now invoke an event from a gaze interaction For the selection side, it looks like we have 2 similar-ish messages already : OnSelect and OnSelectObject Any idea what the difference is ?
That seems like a great idea
@stbertou sounds like a great idea and one step closer to moving towards more polymorphic code :) How about you start with Gaze and OnSelect events? The SelectObject events are for sending messages to focused objects which help tie them with keywords manager.
This is also a good opportunity to think through the event names :)
Hi guys
I think it would be really useful to make the HoloToolKit work nicely with Unity's Event system. Basically invoking an event for when we gaze (OnGazeEnter / OnGazeLeave), when we select (OnSelectObject / OnClearSelection) etc..
I've prototyped it already, happy to put a PR if you also think that would be useful !