Exemple #1
0
        public void OnHandTwoDown(HandEventData eventData)
        {
            Transform tform = eventData.module.transform;
            float     dist  = Vector3.Distance(this.transform.position, tform.position);

            transforms.Add(new KeyValuePair <Transform, float>(tform, dist));
        }
Exemple #2
0
        //Primitives

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

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

            o.label = hand_label;
            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);
            }
        }
Exemple #3
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);
     }
 }
Exemple #4
0
 public void OnHandTwoUp(HandEventData eventData)
 {
     foreach (KeyValuePair <Transform, float> pair in transforms)
     {
         if (pair.Key == eventData.module.transform)
         {
             transforms.Remove(pair);
             return;
         }
     }
 }
 public void OnHandTwoDown(HandEventData eventData)
 {
     if (primary == null)
     {
         primary = eventData.module.transform;
     }
     else if (secondary == null)
     {
         secondary       = eventData.module.transform;
         initialScale    = this.transform.localScale;
         initialDistance = Vector3.Distance(primary.position, secondary.position);
     }
 }
        public void OnHandTwoUp(HandEventData eventData)
        {
            //release primary if primary
            if (primary == eventData.module.transform)
            {
                primary = null;
            }

            //release secondary if secondary
            if (secondary == eventData.module.transform)
            {
                secondary = null;
            }
        }
 public void OnHandTwo(HandEventData eventData)
 {
     //
 }