Exemplo n.º 1
0
 //Sets the above variables as soon as the game starts
 void Start()
 {
     particleSpray       = gameObject.GetComponentInChildren <ParticleSystem>();
     particleSprayObject = gameObject.transform.GetChild(0).gameObject;
     interactable        = GetComponent <Interactable>();
     poser = GetComponent <SteamVR_Skeleton_Poser>();
 }
Exemplo n.º 2
0
    public SteamVR_Skeleton_Poser ClosePoser(Vector3 tempPoint)
    {
        SteamVR_Skeleton_Poser TempClose = null;

        if (grabPoints != null)
        {
            float MinDistance = float.MaxValue;
            for (int i = 0; i < grabPoints.Count; i++)
            {
                if (grabPoints[i] != leftMyGrabPoser && grabPoints[i] != rightMyGrabPoser)
                {
                    if (Vector3.Distance(tempPoint, grabPoints[i].transform.position) < MinDistance)
                    {
                        MinDistance = Vector3.Distance(tempPoint, grabPoints[i].transform.position);
                        TempClose   = grabPoints[i];
                    }
                }
            }
            if (useSecondPose && ifOtherHandUseMainPoseOnThisObject())
            {
                for (int i = 0; i < secondPoses.Count; i++)
                {
                    if (secondPoses [i] != leftMyGrabPoser && secondPoses [i] != rightMyGrabPoser)
                    {
                        if (Vector3.Distance(tempPoint, secondPoses [i].transform.position) < MinDistance)
                        {
                            MinDistance = Vector3.Distance(tempPoint, secondPoses [i].transform.position);
                            TempClose   = secondPoses [i];
                        }
                    }
                }
            }
        }
        return(TempClose);
    }
Exemplo n.º 3
0
 public void DettachHand(CustomHand hand)
 {
     hand.DetachHand();
     if (hand.handType == SteamVR_Input_Sources.LeftHand)
     {
         leftMyGrabPoser = null;
         leftHand        = null;
     }
     if (hand.handType == SteamVR_Input_Sources.RightHand)
     {
         rightMyGrabPoser = null;
         rightHand        = null;
     }
 }
Exemplo n.º 4
0
 public void DettachHands()
 {
     if (leftHand)
     {
         leftHand.DetachHand();
         leftMyGrabPoser = null;
         leftHand        = null;
     }
     if (rightHand)
     {
         rightHand.DetachHand();
         rightMyGrabPoser = null;
         rightHand        = null;
     }
 }
Exemplo n.º 5
0
    void GrabEnd()
    {
        endFramePos = oldInterpolatePos;
        endFrameRot = oldInterpolateRot;

        skeleton.transform.localPosition    = Vector3.zero;
        skeleton.transform.localEulerAngles = Vector3.zero; ///save coord
        skeleton.BlendToSkeleton(blend);

        RenderModelVisible(!HideController);
        blendToPose      = 0;
        grabPoser        = null;
        GrabInteractible = null;
        grabType         = GrabType.None;
    }
Exemplo n.º 6
0
    void GrabEnd()
    {
        endFramePos = transform.parent.InverseTransformPoint(oldInterpolatePos);
        endFrameRot = oldInterpolateRot;

        skeleton.transform.localPosition    = Vector3.zero;
        skeleton.transform.localEulerAngles = Vector3.zero; ///save coord
        skeleton.BlendToSkeleton(blend);

        renderModelVisible(!hideController);
        blendToPose           = 0;
        blendToPoseMoveObject = 0;
        grabPoser             = null;
        grabInteractible      = null;
        grabType = GrabType.None;
    }
Exemplo n.º 7
0
 public void SetInteractibleVariable(CustomHand hand, SteamVR_Skeleton_Poser poser)
 {
     if (hand.handType == SteamVR_Input_Sources.LeftHand)
     {
         if (leftHand)
         {
             DettachHand(leftHand);
         }
         if (!TwoHanded && rightHand)
         {
             DettachHand(rightHand);
         }
         leftMyGrabPoser = poser;
         if (leftMyGrabPoser)
         {
             hand.grabPoser = leftMyGrabPoser;
             leftHand       = hand;
             leftHand.SkeletonUpdate();
         }
         //haptic
     }
     if (hand.handType == SteamVR_Input_Sources.RightHand)
     {
         if (rightHand)
         {
             DettachHand(rightHand);
         }
         if (!TwoHanded && leftHand)
         {
             DettachHand(leftHand);
         }
         rightMyGrabPoser = poser;
         if (rightMyGrabPoser)
         {
             hand.grabPoser = rightMyGrabPoser;
             rightHand      = hand;
             rightHand.SkeletonUpdate();
         }
         //haptic
     }
 }
Exemplo n.º 8
0
 void Start()
 {
     skeletonPoser = GetComponent <SteamVR_Skeleton_Poser>();
 }
Exemplo n.º 9
0
 private void Awake()
 {
     skeletonPoser = GetComponent <SteamVR_Skeleton_Poser>();
     Physics.IgnoreLayerCollision(10, 9, true);
 }
Exemplo n.º 10
0
 internal void NotifyDetachedFrom(SteamVR_Skeleton_Poser poser)
 {
     _skeleton.BlendToSkeleton();
 }
Exemplo n.º 11
0
 internal void NotifyAttachedTo(SteamVR_Skeleton_Poser poser)
 {
     _skeleton.BlendToPoser(poser);
 }
Exemplo n.º 12
0
 private void Awake()
 {
     skeletonPoser = GetComponent <SteamVR_Skeleton_Poser>();
     //renderer = GetComponentInChildren<Animator>().GetComponentInChildren<SkinnedMeshRenderer>();
 }
Exemplo n.º 13
0
 protected override void Start()
 {
     base.Start();
     poser          = GetComponent <SteamVR_Skeleton_Poser>();
     childColliders = GetComponentsInChildren <Collider>();
 }
Exemplo n.º 14
0
 private void Start()
 {
     interactable = GetComponent <Interactable>();
     poser        = GetComponent <SteamVR_Skeleton_Poser>();
 }
Exemplo n.º 15
0
        [SerializeField] private AudioClip[] distractionClips;  // The array of different herring voice clips for each riddle

        private void Awake()
        {
            skeletonPoser      = GetComponent <SteamVR_Skeleton_Poser>();
            isGoalInteractable = false;
            currentPuzzle      = 0;
        }
Exemplo n.º 16
0
 private void Awake()
 {
     skeletonPoser = GetComponent <SteamVR_Skeleton_Poser>();
 }
Exemplo n.º 17
0
 private void Start()
 {
     m_Animator             = GetComponent <Animator>();
     steamVR_Skeleton_Poser = GetComponent <SteamVR_Skeleton_Poser>();
 }