protected override void Shoot(XRBaseInteractor interactor) { base.Shoot(interactor); Projectile projectileInstance = Instantiate(bulletObject, bulletSpawn.position, bulletSpawn.rotation); projectileInstance.Init(this); projectileInstance.Launch(); }
private void OnTriggerExit(Collider other) { if (Array.Exists(hand, i => i.Equals(other.GetComponent <XRBaseInteractor>()))) { canvas.enabled = false; interactor = null; } }
void OnGrabbed(XRBaseInteractor rBaseInteractor) { //attachTransform = rBaseInteractor.attachTransform; attachTransform = grabInteractable.attachTransform; mLocalRot_attachTransform = attachTransform.localRotation; xrInteractor = rBaseInteractor; handPresence = rBaseInteractor.attachTransform.GetComponentInChildren <HandPresence>(); }
private void OnValidate() { // Let's have this done automatically, but not hide the requirement if (!targetInteractor) { targetInteractor = GetComponentInParent <XRBaseInteractor>(); } }
private void TryToReleaseArrow(XRBaseInteractor interactor) { if (currentArrow) { ForceDeselect(); ReleaseArrow(); } }
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>(); }
//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; }
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); }
protected override void OnSelectEnter(XRBaseInteractor interactor) { base.OnSelectEnter(interactor); if (interactor is XRDirectInteractor) { Climber.climbingHand = interactor.GetComponent <XRController>(); } }
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); }
private void OnBeginInteraction(XRBaseInteractor interactor) { currentInteractorTransform = interactor.transform; proxyHand.EnableProxyHandVisual(interactor.GetComponent <ActionBasedController>(), interactor); //interactor.GetComponent<XRBaseController>().hideControllerModel = true; //proxyHand.Activate(); }
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; }
protected override void OnHoverEntered(XRBaseInteractor interactor) { if (interactor is XRDirectInteractor) { PlayKeySound(); key.PressKey(); } }
private void OnTriggerExit() { pressZ = 0f; CheckPress(); hoverInteractor = null; previousPressState = false; }
//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); } }
//Called when we finish interaction with the button protected override void OnSelectExit(XRBaseInteractor interactor) { base.OnSelectExit(interactor); SetYPosition(yMax); OnRelease.Invoke(); }
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); }
public void EndPush(HoverExitEventArgs arg0) { pushInteractor = null; previousPushDepth = 0.0f; previouslyPushed = false; SetYPosition(minimalPushDepth); }
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); } }
private void ManipulateEndEvent(GameObject _obj, XRBaseInteractor _interactor) { if (_obj == titleBar) { this.ManipulateEnd.Invoke(); billboard.Interactor = null; billboard.IsInteract = false; } }
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; }