Exemple #1
0
    protected override void Shoot(XRBaseInteractor interactor)
    {
        base.Shoot(interactor);
        Projectile projectileInstance = Instantiate(bulletObject, bulletSpawn.position, bulletSpawn.rotation);

        projectileInstance.Init(this);
        projectileInstance.Launch();
    }
Exemple #2
0
 private void OnTriggerExit(Collider other)
 {
     if (Array.Exists(hand, i => i.Equals(other.GetComponent <XRBaseInteractor>())))
     {
         canvas.enabled = false;
         interactor     = null;
     }
 }
Exemple #3
0
 void OnGrabbed(XRBaseInteractor rBaseInteractor)
 {
     //attachTransform = rBaseInteractor.attachTransform;
     attachTransform           = grabInteractable.attachTransform;
     mLocalRot_attachTransform = attachTransform.localRotation;
     xrInteractor = rBaseInteractor;
     handPresence = rBaseInteractor.attachTransform.GetComponentInChildren <HandPresence>();
 }
Exemple #4
0
 private void OnValidate()
 {
     // Let's have this done automatically, but not hide the requirement
     if (!targetInteractor)
     {
         targetInteractor = GetComponentInParent <XRBaseInteractor>();
     }
 }
Exemple #5
0
 private void TryToReleaseArrow(XRBaseInteractor interactor)
 {
     if (currentArrow)
     {
         ForceDeselect();
         ReleaseArrow();
     }
 }
Exemple #6
0
 private void SpawnBall(XRBaseInteractor interactable)
 {
     buttonHeld           = true;
     currentBall          = Instantiate(ball, spawnPoint.position, Quaternion.identity).transform;
     ballCollider         = currentBall.GetComponent <SphereCollider>();
     ballCollider.enabled = false;
     ballTrail            = currentBall.gameObject.GetComponent <TrailRenderer>();
 }
Exemple #7
0
    //Called when we begin interaction with the button
    protected override void OnSelectEnter(XRBaseInteractor interactor)
    {
        base.OnSelectEnter(interactor);

        SetYPosition(yMin);

        OnPress.Invoke();
    }
    /// <inheritdoc />
    protected override void OnSelectExiting(SelectExitEventArgs args)
    {
        base.OnSelectExiting(args);
        XRBaseInteractor interactor = args.interactor;

        interactor.attachTransform.localPosition = initialAttachPosition;
        interactor.attachTransform.localRotation = initialAttachRotation;
    }
Exemple #9
0
    private void EndPress(XRBaseInteractor interactor)
    {
        hoverInteract  = null;
        previousHeight = 0.0f;

        previousPress = false;
        setY(yMax);
    }
    private void ApplyValue(SelectExitEventArgs eventArgs)
    {
        XRBaseInteractor interactor = eventArgs.interactor;
        bool             isOn       = InOnPosition(interactor.transform.position);

        FindSnapDirection(isOn);
        SetValue(isOn);
    }
Exemple #11
0
 protected override void OnSelectEnter(XRBaseInteractor interactor)
 {
     base.OnSelectEnter(interactor);
     if (interactor is XRDirectInteractor)
     {
         Climber.climbingHand = interactor.GetComponent <XRController>();
     }
 }
Exemple #12
0
 protected override void OnSelectEntered(XRBaseInteractor interactor)
 {
     base.OnSelectEntered(interactor);
     if (interactor is XRDirectInteractor)
     {
         controller = interactor.GetComponent <ActionBasedController>();
     }
 }
    /// <inheritdoc />
    protected override void OnSelectExiting(SelectExitEventArgs args)
    {
        base.OnSelectExiting(args);

        XRBaseInteractor interactor = args.interactor;

        OnSelectExiting(interactor);
    }
    /// <inheritdoc />
    protected override void OnHoverEntered(HoverEnterEventArgs args)
    {
        base.OnHoverEntered(args);

        XRBaseInteractor interactor = args.interactor;

        OnHoverEntered(interactor);
    }
Exemple #15
0
    private void OnBeginInteraction(XRBaseInteractor interactor)
    {
        currentInteractorTransform = interactor.transform;
        proxyHand.EnableProxyHandVisual(interactor.GetComponent <ActionBasedController>(), interactor);

        //interactor.GetComponent<XRBaseController>().hideControllerModel = true;
        //proxyHand.Activate();
    }
Exemple #16
0
 protected override void OnSelectExiting(SelectExitEventArgs args)
 {
     Debug.Log("First Grab Exit");
     base.OnSelectExiting(args);
     secondInteractor       = null;
     pickCollider.isTrigger = false;
     args.interactor.attachTransform.localRotation = attachInitialRotation;
 }
    protected override void OnSelectEnter(XRBaseInteractor interactor)
    {
        base.OnSelectEnter(interactor);

        canSelect                = true;
        isSelectExit             = false;
        selectRecognitionTimeVal = 0f;
    }
Exemple #18
0
 protected override void OnHoverEntered(XRBaseInteractor interactor)
 {
     if (interactor is XRDirectInteractor)
     {
         PlayKeySound();
         key.PressKey();
     }
 }
        private void OnTriggerExit()
        {
            pressZ = 0f;
            CheckPress();

            hoverInteractor    = null;
            previousPressState = false;
        }
Exemple #20
0
 //Add interactor so the button knows what hand is interacting with it
 private void StartPress(XRBaseInteractor interactor)
 {
     if (isClicked == false)
     {
         HoverInteractor   = interactor;
         PreviousHandHight = GetLocalYPosition(HoverInteractor.transform.position);
     }
 }
Exemple #21
0
    //Called when we finish interaction with the button
    protected override void OnSelectExit(XRBaseInteractor interactor)
    {
        base.OnSelectExit(interactor);

        SetYPosition(yMax);

        OnRelease.Invoke();
    }
Exemple #22
0
 private void EndPress(XRBaseInteractor interactor)
 {
     HoverInteractor   = null;
     PreviousHandHight = 0.0f;
     PreviousPress     = false;
     SetYPosition(yMax);
     isClicked = true;
 }
    private void EndPress(XRBaseInteractor interactor)
    {
        hoverInteractor    = null;
        previousHandHeight = 0.0f;

        previousPress = false;
        SetYPosition(yMax);
    }
Exemple #24
0
    public void EndPush(HoverExitEventArgs arg0)
    {
        pushInteractor    = null;
        previousPushDepth = 0.0f;

        previouslyPushed = false;
        SetYPosition(minimalPushDepth);
    }
Exemple #25
0
 protected override void OnSelectEnter(XRBaseInteractor interactor)
 {
     base.OnSelectEnter(interactor);
     if (interactor is XRDirectInteractor)
     {
         XRRigManager.I.OnSelectEnter("climbing", interactor);
     }
 }
 void OnGrabbed(XRBaseInteractor rBaseInteractor)
 {
     isGrabbed  = true;
     isActivate = alwaysActivateOnGrabbed;
     SetAnimation();
     SetPhysicsColliders();
     SetActivateColliders();
 }
    public void ChangePose(HandPoses newPose, XRBaseInteractor interactor)
    {
        HandVisuals visuals = interactor.GetComponentInChildren <HandVisuals>();

        if (visuals != null)
        {
            visuals.LockPose(newPose);
        }
    }
Exemple #28
0
 private void ManipulateEndEvent(GameObject _obj, XRBaseInteractor _interactor)
 {
     if (_obj == titleBar)
     {
         this.ManipulateEnd.Invoke();
         billboard.Interactor = null;
         billboard.IsInteract = false;
     }
 }
Exemple #29
0
 private void ManipulateStartEvent(GameObject _obj, XRBaseInteractor _interactor)
 {
     if (_obj == titleBar)
     {
         this.ManipulateStart.Invoke();
         billboard.Interactor = _interactor;
         billboard.IsInteract = true;
     }
 }
    //réécrire OnSelectExiting donc avec la 1ere main
    protected override void OnSelectExiting(XRBaseInteractor interactor)
    {
        base.OnSelectExiting(interactor);
        //lâche aussi avec la 2e main
        secondInteractor = null;

        //l'objet reprend sa rotation initiale
        interactor.attachTransform.localRotation = attachInitialLocalRot;
    }