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

        projectileInstance.Init(this);
        projectileInstance.Launch();
    }
Пример #2
0
 private void OnTriggerExit(Collider other)
 {
     if (Array.Exists(hand, i => i.Equals(other.GetComponent <XRBaseInteractor>())))
     {
         canvas.enabled = false;
         interactor     = null;
     }
 }
Пример #3
0
 void OnGrabbed(XRBaseInteractor rBaseInteractor)
 {
     //attachTransform = rBaseInteractor.attachTransform;
     attachTransform           = grabInteractable.attachTransform;
     mLocalRot_attachTransform = attachTransform.localRotation;
     xrInteractor = rBaseInteractor;
     handPresence = rBaseInteractor.attachTransform.GetComponentInChildren <HandPresence>();
 }
Пример #4
0
 private void OnValidate()
 {
     // Let's have this done automatically, but not hide the requirement
     if (!targetInteractor)
     {
         targetInteractor = GetComponentInParent <XRBaseInteractor>();
     }
 }
Пример #5
0
 private void TryToReleaseArrow(XRBaseInteractor interactor)
 {
     if (currentArrow)
     {
         ForceDeselect();
         ReleaseArrow();
     }
 }
Пример #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>();
 }
Пример #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;
    }
Пример #9
0
    private void EndPress(XRBaseInteractor interactor)
    {
        hoverInteract  = null;
        previousHeight = 0.0f;

        previousPress = false;
        setY(yMax);
    }
Пример #10
0
    private void ApplyValue(SelectExitEventArgs eventArgs)
    {
        XRBaseInteractor interactor = eventArgs.interactor;
        bool             isOn       = InOnPosition(interactor.transform.position);

        FindSnapDirection(isOn);
        SetValue(isOn);
    }
Пример #11
0
 protected override void OnSelectEnter(XRBaseInteractor interactor)
 {
     base.OnSelectEnter(interactor);
     if (interactor is XRDirectInteractor)
     {
         Climber.climbingHand = interactor.GetComponent <XRController>();
     }
 }
Пример #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);
    }
Пример #15
0
    private void OnBeginInteraction(XRBaseInteractor interactor)
    {
        currentInteractorTransform = interactor.transform;
        proxyHand.EnableProxyHandVisual(interactor.GetComponent <ActionBasedController>(), interactor);

        //interactor.GetComponent<XRBaseController>().hideControllerModel = true;
        //proxyHand.Activate();
    }
Пример #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;
 }
Пример #17
0
    protected override void OnSelectEnter(XRBaseInteractor interactor)
    {
        base.OnSelectEnter(interactor);

        canSelect                = true;
        isSelectExit             = false;
        selectRecognitionTimeVal = 0f;
    }
Пример #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;
        }
Пример #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);
     }
 }
Пример #21
0
    //Called when we finish interaction with the button
    protected override void OnSelectExit(XRBaseInteractor interactor)
    {
        base.OnSelectExit(interactor);

        SetYPosition(yMax);

        OnRelease.Invoke();
    }
Пример #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);
    }
Пример #24
0
    public void EndPush(HoverExitEventArgs arg0)
    {
        pushInteractor    = null;
        previousPushDepth = 0.0f;

        previouslyPushed = false;
        SetYPosition(minimalPushDepth);
    }
Пример #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);
        }
    }
Пример #28
0
 private void ManipulateEndEvent(GameObject _obj, XRBaseInteractor _interactor)
 {
     if (_obj == titleBar)
     {
         this.ManipulateEnd.Invoke();
         billboard.Interactor = null;
         billboard.IsInteract = false;
     }
 }
Пример #29
0
 private void ManipulateStartEvent(GameObject _obj, XRBaseInteractor _interactor)
 {
     if (_obj == titleBar)
     {
         this.ManipulateStart.Invoke();
         billboard.Interactor = _interactor;
         billboard.IsInteract = true;
     }
 }
Пример #30
0
    //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;
    }