Exemplo n.º 1
0
 private void EventDispatcher(HandGestureEvent e)
 {
     if (e == null)
     {
         throw new NullReferenceException($"{nameof(HandGestureEvent)} can not be null, please check {nameof(MADUnityIntegrator)} logic.");
     }
     else if (e is HandDetected)
     {
         EventHandDetected?.Invoke((HandDetected)e);
     }
     else if (e is Click)
     {
         EventClick?.Invoke((Click)e);
     }
     else if (e is Grab)
     {
         EventGrab?.Invoke((Grab)e);
     }
     else if (e is Hold)
     {
         EventHold?.Invoke((Hold)e);
     }
     else
     {
         throw new NotImplementedException($"Fail to dispatch {nameof(HandGestureEvent)}, non implement type detected.");
     }
 }
Exemplo n.º 2
0
 protected virtual void Awake()
 {
     _eventHold = new EventHold();
     _container = new ObjectContainer(this);
     _abstruct  = this;
 }