Exemplo n.º 1
0
        public void OnHandsDetected(HandAbstraction hands)
        {
            Initialise();

            leftHand  = hands.GetLeftHand();
            rightHand = hands.GetRightHand();
        }
Exemplo n.º 2
0
        /** External API for host game.
         *  Retrives the GameObject for a given hand.
         */
        public GameObject GetHand(Hand hand)
        {
            if (handAbstraction == null)
            {
                return(null);
            }

            return(hand == Hand.Left ? handAbstraction.GetLeftHand() : handAbstraction.GetRightHand());
        }
Exemplo n.º 3
0
        public void OnHandsDetected(HandAbstraction hands, Camera eventCamera)
        {
            targetHand = isLeft ? hands.GetLeftHand() : hands.GetRightHand();

            this.transform.localScale = new Vector3(0.002f * panelScale, 0.002f * panelScale, 0.002f * panelScale);

            if (canvas != null)
            {
                canvas.worldCamera = eventCamera;
            }

            TrackTargetHand();
        }
Exemplo n.º 4
0
        void Update()
        {
            if (hands != null)
            {
                bool isInBox = IsInBox(hands.GetLeftHand()) || IsInBox(hands.GetRightHand());

                bool sendEvent = (isInBox && !wasInBox);
                wasInBox = isInBox;

                if (sendEvent)
                {
                    OnHandEntered();
                }
            }
        }