private void Update() { Vector3 rot = VRTK_DeviceFinder.GetModelAliasController(gameObject).transform.rotation.eulerAngles; if ((Mathf.Abs(rot.x) > 360 - angleThreshold || Mathf.Abs(rot.x) < angleThreshold) && (Mathf.Abs(rot.z) > 180 - angleThreshold && Mathf.Abs(rot.z) < 180 + angleThreshold)) { t += Time.deltaTime; } else { t = 0; if (menuDisplaying) { Debug.Log("hiding menu"); StopCoroutine(DisplayMenu()); StartCoroutine(HideMenu()); } } if (t > menuDelay) { if (!menuDisplaying) { StartCoroutine(DisplayMenu()); } } }
private void DoGripPressed(object sender, ControllerInteractionEventArgs e) { tooltips.ToggleTips(true, VRTK_ControllerTooltips.TooltipButtons.GripTooltip); highligher.HighlightElement(SDK_BaseController.ControllerElements.GripLeft, highlightColor, highlightTimer); highligher.HighlightElement(SDK_BaseController.ControllerElements.GripRight, highlightColor, highlightTimer); VRTK_ObjectAppearance.SetOpacity(VRTK_DeviceFinder.GetModelAliasController(events.gameObject), dimOpacity); }
private void DoTouchpadReleased(object sender, ControllerInteractionEventArgs e) { tooltips.ToggleTips(false, VRTK_ControllerTooltips.TooltipButtons.TouchpadTooltip); highligher.UnhighlightElement(SDK_BaseController.ControllerElements.Touchpad); if (!events.AnyButtonPressed()) { VRTK_ObjectAppearance.SetOpacity(VRTK_DeviceFinder.GetModelAliasController(events.gameObject), defaultOpacity); } }
private void DoStartMenuReleased(object sender, ControllerInteractionEventArgs e) { tooltips.ToggleTips(false, VRTK_ControllerTooltips.TooltipButtons.StartMenuTooltip); highligher.UnhighlightElement(SDK_BaseController.ControllerElements.StartMenu); if (!events.AnyButtonPressed()) { VRTK_SharedMethods.SetOpacity(VRTK_DeviceFinder.GetModelAliasController(events.gameObject), defaultOpacity); } }
// Token: 0x06001E25 RID: 7717 RVA: 0x00098F68 File Offset: 0x00097168 private void DoButtonOneReleased(object sender, ControllerInteractionEventArgs e) { this.tooltips.ToggleTips(false, VRTK_ControllerTooltips.TooltipButtons.ButtonOneTooltip); this.highligher.UnhighlightElement(SDK_BaseController.ControllerElements.ButtonOne); if (!this.events.AnyButtonPressed()) { VRTK_ObjectAppearance.SetOpacity(VRTK_DeviceFinder.GetModelAliasController(this.events.gameObject), this.defaultOpacity, 0f); } }
private void DoTriggerPressed(object sender, ControllerInteractionEventArgs e) { tooltips.ToggleTips(true, VRTK_ControllerTooltips.TooltipButtons.TriggerTooltip); highligher.HighlightElement(SDK_BaseController.ControllerElements.Trigger, highlightColor, (pulseTriggerHighlightColor ? pulseTimer : highlightTimer)); if (pulseTriggerHighlightColor) { InvokeRepeating("PulseTrigger", pulseTimer, pulseTimer); } VRTK_ObjectAppearance.SetOpacity(VRTK_DeviceFinder.GetModelAliasController(events.gameObject), dimOpacity); }
private void DoTriggerReleased(object sender, ControllerInteractionEventArgs e) { tooltips.ToggleTips(false, VRTK_ControllerTooltips.TooltipButtons.TriggerTooltip); highligher.UnhighlightElement(SDK_BaseController.ControllerElements.Trigger); if (pulseTriggerHighlightColor) { CancelInvoke("PulseTrigger"); } if (!events.AnyButtonPressed()) { VRTK_SharedMethods.SetOpacity(VRTK_DeviceFinder.GetModelAliasController(events.gameObject), defaultOpacity); } }
// Token: 0x06001E23 RID: 7715 RVA: 0x00098EAC File Offset: 0x000970AC private void DoTriggerReleased(object sender, ControllerInteractionEventArgs e) { this.tooltips.ToggleTips(false, VRTK_ControllerTooltips.TooltipButtons.TriggerTooltip); this.highligher.UnhighlightElement(SDK_BaseController.ControllerElements.Trigger); if (this.pulseTriggerHighlightColor) { base.CancelInvoke("PulseTrigger"); } if (!this.events.AnyButtonPressed()) { VRTK_ObjectAppearance.SetOpacity(VRTK_DeviceFinder.GetModelAliasController(this.events.gameObject), this.defaultOpacity, 0f); } }
public override void StartReaction(object o, EventArgs e) { // See if this is directly an InteractableObject event InteractableObjectEventArgs interactableArgs = e as InteractableObjectEventArgs; if (interactableArgs != null) { controllerModel = VRTK_DeviceFinder.GetModelAliasController(interactableArgs.interactingObject); } else { controllerModel = GetControllerModelFromEvent(e); } if (controllerModel != null) { VRTK_ObjectAppearance.SetRendererHidden(controllerModel); } }
/// <summary> /// 手柄透明 /// </summary> /// <param name="transparence">透明度</param> public void ControllerSetTransparence(float transparence) { Transform e = highlighter.GetElementTransform(highlighter.GetPathForControllerElement(SDK_BaseController.ControllerElements.Body)); if (transparence == 1 && BodyInitMaterial) { Material m = e.gameObject.GetComponent <MeshRenderer>().material; m = BodyInitMaterial; m.SetFloat("_Mode", 0); m.SetInt("_SrcBlend", (int)UnityEngine.Rendering.BlendMode.One); m.SetInt("_DstBlend", (int)UnityEngine.Rendering.BlendMode.Zero); m.SetInt("_ZWrite", 1); m.DisableKeyword("_ALPHATEST_ON"); m.DisableKeyword("_ALPHABLEND_ON"); m.DisableKeyword("_ALPHAPREMULTIPLY_ON"); m.renderQueue = -1; return; } BodyInitMaterial = e.gameObject.GetComponent <MeshRenderer>().material; VRTK_ObjectAppearance.SetOpacity(VRTK_DeviceFinder.GetModelAliasController(gameObject), transparence); }
private GameObject GetControllerModelFromEvent(EventArgs e) { InteractionAreaEventArgs interactionAreaEventArgs = e as InteractionAreaEventArgs; if (interactionAreaEventArgs != null) { if (interactionAreaEventArgs.hasMoreReactionInfo) { ControllerEventArgSender eventArgsSender = interactionAreaEventArgs.interactionObject.GetComponent <ControllerEventArgSender>(); if (eventArgsSender != null) { ControllerReactionEventArgs eventArgs = eventArgsSender.GetEventArgs() as ControllerReactionEventArgs; return(VRTK_DeviceFinder.GetModelAliasController(eventArgs.interactingController)); } } } return(null); }
// Token: 0x06001EC0 RID: 7872 RVA: 0x0009C248 File Offset: 0x0009A448 private bool NoArrowNotched(GameObject controller) { if (VRTK_DeviceFinder.IsControllerLeftHand(controller)) { GameObject controllerRightHand = VRTK_DeviceFinder.GetControllerRightHand(true); this.bow = controllerRightHand.GetComponentInChildren <BowAim>(); if (this.bow == null) { this.bow = VRTK_DeviceFinder.GetModelAliasController(controllerRightHand).GetComponentInChildren <BowAim>(); } } else if (VRTK_DeviceFinder.IsControllerRightHand(controller)) { GameObject controllerLeftHand = VRTK_DeviceFinder.GetControllerLeftHand(true); this.bow = controllerLeftHand.GetComponentInChildren <BowAim>(); if (this.bow == null) { this.bow = VRTK_DeviceFinder.GetModelAliasController(controllerLeftHand).GetComponentInChildren <BowAim>(); } } return(this.bow == null || !this.bow.HasArrow()); }
/// <summary> /// 显示控制器 /// </summary> public void ControllerVisible() { VRTK_ObjectAppearance.SetRendererVisible(VRTK_DeviceFinder.GetModelAliasController(gameObject)); }
//Fonction de vibration de la manette (à appeler en Event) public void StartHapticTouch() { controllerReference = VRTK_ControllerReference.GetControllerReference(VRTK_DeviceFinder.GetModelAliasController(events.gameObject)); VRTK_ControllerHaptics.TriggerHapticPulse(controllerReference, strengthOnTouch, durationOnTouch, intervalOnTouch); }
private void DoButtonOnePressed(object sender, ControllerInteractionEventArgs e) { tooltips.ToggleTips(true, VRTK_ControllerTooltips.TooltipButtons.ButtonOneTooltip); highligher.HighlightElement(SDK_BaseController.ControllerElements.ButtonOne, highlightColor, highlightTimer); VRTK_SharedMethods.SetOpacity(VRTK_DeviceFinder.GetModelAliasController(events.gameObject), dimOpacity); }
// Token: 0x06001E26 RID: 7718 RVA: 0x00098FBC File Offset: 0x000971BC private void DoButtonTwoPressed(object sender, ControllerInteractionEventArgs e) { this.tooltips.ToggleTips(true, VRTK_ControllerTooltips.TooltipButtons.ButtonTwoTooltip); this.highligher.HighlightElement(SDK_BaseController.ControllerElements.ButtonTwo, this.highlightColor, this.highlightTimer); VRTK_ObjectAppearance.SetOpacity(VRTK_DeviceFinder.GetModelAliasController(this.events.gameObject), this.dimOpacity, 0f); }