Exemplo n.º 1
0
        //Primitives

        ///////////////////////////////////////////////////////////////////////////
        //
        // Inherited from MonoBehaviour
        //

        void Awake()
        {
            eventData = new HandEventData(EventSystem.current);
            //make finger objects
            TrackedObject o = new GameObject().AddComponent <TrackedObject>();

            o.liveObjectTag = handTag;
            hand            = o.transform;
            thumb           = MakeFinger(thumb_label, "_thumb");
            index           = MakeFinger(index_label, "_index");
            middle          = MakeFinger(middle_label, "_middle");
            ring            = MakeFinger(ring_label, "_ring");
            pinky           = MakeFinger(pinky_label, "_pinky");

            eventData.module = this;
            eventData.thumb  = thumb;
            eventData.index  = index;
            eventData.middle = middle;
            eventData.ring   = ring;
            eventData.pinky  = pinky;

            foreach (HandStatus status in Enum.GetValues(typeof(HandStatus)))
            {
                statusPairings.Add(status, null);
            }
        }
Exemplo n.º 2
0
 protected void HandlePointerExitAndEnter(HandEventData eventData)
 {
     if (eventData.previousRaycast != eventData.currentRaycast)
     {
         ExecuteEvents.Execute <IPointerEnterHandler>(eventData.currentRaycast, eventData, ExecuteEvents.pointerEnterHandler);
         ExecuteEvents.Execute <IPointerExitHandler>(eventData.previousRaycast, eventData, ExecuteEvents.pointerExitHandler);
     }
 }