Пример #1
0
 //-------------------------------------------------
 private void AttachedToHand(Hand attachedHand)
 {
     _hand      = attachedHand;
     _selection = _hand.GetComponentInChildren <SelectionWheel>();
     SetSelection();
     FindBow();
 }
Пример #2
0
 private void HandHoverUpdate(Hand hand)
 {
     if (hand.GetStandardInteractionButtonDown() || ((hand.controller != null) && hand.controller.GetPressDown(Valve.VR.EVRButtonId.k_EButton_Grip)))
     {
         if (hand.currentAttachedObject != gameObject)
         {
             hand.HoverLock(GetComponent <Interactable>());
             hand.AttachObject(gameObject, attachmentFlags);
             GetComponentInChildren <Collider>().gameObject.layer = LayerMask.NameToLayer("IgnoreTeleport");
             hand.GetComponentInChildren <HandControllerState>().gameObject.SetActive(false);
         }
         else
         {
             hand.DetachObject(gameObject);
             hand.HoverUnlock(GetComponent <Interactable>());
             GetComponentInChildren <Collider>().gameObject.layer = LayerMask.NameToLayer("Default");
             hand.GetComponentInChildren <HandControllerState>(true).gameObject.SetActive(true);
         }
     }
 }
Пример #3
0
 private static ControllerButtonHints GetControllerButtonHints(Hand hand)
 {
     if (hand != null)
     {
         ControllerButtonHints componentInChildren = hand.GetComponentInChildren <ControllerButtonHints>();
         if (componentInChildren != null && componentInChildren.initialized)
         {
             return(componentInChildren);
         }
     }
     return(null);
 }
Пример #4
0
        //-------------------------------------------------
        // These are the static functions which are used to show/hide the hints
        //-------------------------------------------------

        //-------------------------------------------------
        private static ControllerButtonHints GetControllerButtonHints(Hand hand)
        {
            if (hand != null)
            {
                ControllerButtonHints hints = hand.GetComponentInChildren <ControllerButtonHints>();
                if (hints != null && hints.initialized)
                {
                    return(hints);
                }
            }

            return(null);
        }