protected virtual void OnAttachedToHand(Hand hand) { if (activateActionSetOnAttach != null) { if (actionSetPriority != -1) { activateActionSetOnAttach.Activate(hand.handType, actionSetPriority, false); } else { activateActionSetOnAttach.Activate(hand.handType); } } if (onAttachedToHand != null) { onAttachedToHand.Invoke(hand); } if (skeletonPoser != null && hand.skeleton != null) { hand.skeleton.BlendToPoser(skeletonPoser, blendToPoseTime); } attachedToHand = hand; }
void UpdateAnimatorKnuckles() { SteamVR_Input_Sources inputSource = (controllerHand.IsLeft) ? SteamVR_Input_Sources.LeftHand : SteamVR_Input_Sources.RightHand; if (!assistActionset.IsActive()) { assistActionset.Activate(inputSource); } animator.SetBool(isGrabbedHash, grabGrip.GetState(inputSource)); faceButtonTouch = (aButtonTouch.GetState(inputSource) || bButtonTouch.GetState(inputSource) || trackpadTouch.GetState(inputSource)); isTriggerTouch = triggerTouch.GetState(inputSource); isPinching = faceButtonTouch; if (faceButtonTouch) { pinchThumbHoriz += (trackpadTouch.GetState(inputSource) ? -1 : 1) * Time.deltaTime * 6; pinchThumbHoriz = Mathf.Clamp01(pinchThumbHoriz); } animator.SetBool(isPinchingHash, isPinching); animator.SetFloat(pinchAmtHash, skeletonBehavior.fingerCurls[1]); animator.SetFloat(pinchThumbHorizHash, pinchThumbHoriz); pinchTweenTime += (isPinching) ? Time.deltaTime : -Time.deltaTime; pinchTweenTime = Mathf.Clamp(pinchTweenTime, 0, pinchTweenDuration); pinchTValue = Mathf.InverseLerp(0, pinchTweenDuration, pinchTweenTime); if (skeletonBehavior) { skeletonBehavior.indexSkeletonBlend = 1 - pinchTValue; skeletonBehavior.thumbSkeletonBlend = 1 - pinchTValue; } }
private void Start() { activateActionSetOnAttach_Platformer.Activate(SteamVR_Input_Sources.LeftHand); // 左のコントローラーのplatformerを有効へ activateActionSetOnAttach_Platformer.Activate(SteamVR_Input_Sources.RightHand); // 右のコントローラーのplatformerを有効へ activateActionSetOnAttach_Buggy.Activate(SteamVR_Input_Sources.LeftHand); // 左のコントローラーのbuggyを有効へ activateActionSetOnAttach_Buggy.Activate(SteamVR_Input_Sources.RightHand); // 右のコントローラーのbuggyを有効へ activateActionSetOnAttach_Mixedreality.Activate(SteamVR_Input_Sources.LeftHand); // 左のコントローラーのmixedrealityを有効へ activateActionSetOnAttach_Mixedreality.Activate(SteamVR_Input_Sources.RightHand); // 右のコントローラーのmixedrealityを有効へ }
//========================================================================= void Awake() { if (actionSet != null) { actionSet.Activate(hand.handType); } if (hand == null) { Debug.LogWarning("Bracelet component does not have reference to a SteamVR Hand component."); } else { if (bracelets.ContainsKey(this.hand.handType)) { bracelets[this.hand.handType] = this; } else { bracelets.Add(this.hand.handType, this); } if (this.hand.handType == SteamVR_Input_Sources.LeftHand) { handedness = Handedness.Left; } else if (this.hand.handType == SteamVR_Input_Sources.RightHand) { handedness = Handedness.Right; } } }
protected virtual void OnAttachedToHand(Hand hand) { GameObject obj = GameObject.Find("Highlighter"); if (obj != null) { Destroy(obj); } if (activateActionSetOnAttach != null) { activateActionSetOnAttach.Activate(hand.handType); } if (onAttachedToHand != null) { onAttachedToHand.Invoke(hand); } if (skeletonPoser != null && hand.skeleton != null) { hand.skeleton.BlendToPoser(skeletonPoser, blendToPoseTime); } attachedToHand = hand; }
private void Start() { actionSetEnable.Activate(); this.SelectWithRightHand(); toggle2 = SteamVR_Actions._default.GrabPinch; select2 = SteamVR_Actions._default.GrabGrip; }
protected virtual void OnAttachedToHand(Hand hand) { if (activateActionSetOnAttach != null) { activateActionSetOnAttach.Activate(hand.handType); } if (onAttachedToHand != null) { onAttachedToHand.Invoke(hand); } if (skeletonPoser != null && hand.skeleton != null) { hand.skeleton.BlendToPoser(skeletonPoser, blendToPoseTime); } // Play if the track isn't already playing if (!audioSource.isPlaying) { if (!isGoalInteractable) { // Grab the distraction for the current riddle audioSource.clip = distractionClips[currentPuzzle]; } audioSource.panStereo = Random.Range(-1, 1); audioSource.Play(); } attachedToHand = hand; }
protected virtual void OnAttachedToHand(Hand hand) { if (activateActionSetOnAttach != null) { activateActionSetOnAttach.Activate(hand.handType); } if (onAttachedToHand != null) { onAttachedToHand.Invoke(hand); } if (skeletonPoser != null && hand.skeleton != null) { hand.skeleton.BlendToPoser(skeletonPoser, blendToPoseTime); } /* * * * float handx = hand.transform.position.x; * float handy = hand.transform.position.y; * float handz = hand.transform.position.z; * * float newposx = attachedToHand.currentAttachedObject.transform.position.x - handx; * float newposy = attachedToHand.currentAttachedObject.transform.position.y - handy; * float newposz = attachedToHand.currentAttachedObject.transform.position.z - handz; * * //attachedToHand.currentAttachedObject.transform.position = new Vector3(handx, handy, handz); */ attachedToHand = hand; }
// Start is called before the first frame update void Start() { timeWarp = gameObject.GetComponent <TimeWarp>(); actionset.Activate(); timeWarpInput[inputSource].onChange += OnWarpAction;; }
void Start() { wceAction.Activate(); DischargeObserve(); PauseButtonObserve(); AttributeChangeObserve(); }
// Start is called before the first frame update void Start() { animator = GetComponent <Animator>(); root = transform.Find("Root"); steamVR_ActionSet.Activate(SteamVR_Input_Sources.Any, 0, true); animationController = GetComponent <RobotAnimation>(); }
// Start is called before the first frame update. At the beginning user is in menu and robot is locked. void Start() { playerTextPanel.SetActive(false); inMenu = true; isLocked = true; menuSet.Activate(); }
public void TempEnableInteraction(SteamVR_Input_Sources source) { if (interactionEnabled) { return; } //mainActionSet.Deactivate(SteamVR_Input_Sources.Any); mainActionSet.Activate(SteamVR_Input_Sources.Any, 0x01000001); }
//----------------------------VR private void OnEnable() { squeezeActions.Activate(); if (squeezePause != null) { squeezePause.AddOnChangeListener(OnTriggerPressedOrReleased, inputSource); //Debug.Log("StageMenuManager Awake Has Ran"); } }
// Initialize button actions for y position controls of player. private void InitializeButtons() { button_down.onStateDown += Button_down_onStateDown; button_down.onState += Button_down_onState; button_down.onStateUp += Button_down_onStateUp; button_up.onStateDown += Button_up_onStateDown; button_up.onState += Button_up_onState; button_up.onStateUp += Button_up_onStateUp; playerControlActionSet.Activate(); }
private void Awake() { if (actionSet == null) { actionSet = SteamVR_Actions.Controller_Tests; } actionSet.Activate(SteamVR_Input_Sources.Any, 0, true); Left_Hand_Skeleton = SteamVR_Actions.Controller_Tests.Left_Hand_Skeleton; triggered = SteamVR_Actions.Controller_Tests.Left_Trigger_Click; triggered[SteamVR_Input_Sources.Any].onStateDown += PreformAction; }
public void Start() { try { scoreManager = (ScoreManager.ScoreManager)core.pluginManager.Find("score_manager"); } catch (Exception e) { Debug.Log(e); } uiActionSet.Activate(); ToMainMenu(); PopulateInGamePanels(); }
// Start is called before the first frame update void Start() { teleport = Object.FindObjectOfType <Teleport>(); myAction.Activate(); targetObjects.SetActive(false); //teleportPoints = GameObject.FindGameObjectsWithTag("TeleportPoint"); //foreach (GameObject obj in teleportPoints) // obj.SetActive(false); }
private void updateMainActionSetState() { bool useVrControls = VHVRConfig.UseVrControls(); if (!useVrControls && mainActionSet.IsActive()) { mainActionSet.Deactivate(); } else if (useVrControls && !mainActionSet.IsActive()) { mainActionSet.Activate(); } }
public virtual void OnPickup(MyHand hand) { // activate ActionSet if (activateActionSet != null) { activateActionSet.Activate(hand.handType); } // hide hand model if (hideHandModelOnPickUp) { hand.transform.GetChild(0).gameObject.SetActive(false); } }
private void ActionSetPointcloudViewEnabled(bool enabled) { if (_action_set_pointcloud_view != null) { if (enabled) { _action_set_pointcloud_view.Activate(); } else { _action_set_pointcloud_view.Deactivate(); } } }
void UpdateDisplay() { ui_actionInput.SetActive(drawActionInput); ui_rawInput.SetActive(drawRawInput); if (drawRawInput) { rawActionSet.Activate(); } else { rawActionSet.Deactivate(); } }
// Start is called before the first frame update. // RosBridge is used to decide whether Ros is connected to Unity. Only than the simulation scene can be started. void Start() { rosbridge = GameObject.Find("RosBridge").GetComponent <RosConnector>(); line = GetComponent <LineRenderer>(); line.startWidth = 0.005f; line.endWidth = 0.001f; line.positionCount = 2; robots = GameObject.FindGameObjectsWithTag("robot"); trigger.onStateDown += Trigger_onStateDown; SelectRobot.Activate(); }
void SelectActionSet() { if (inZone == true) { //Debug.Log(string.Format("[SteamVR] Activating {0} action set.", actionSet.fullPath)); dartsActionSet.Activate(forSources, 0, disableAllOtherActionSets); //defaultActionSet.Deactivate(forSources); } else { dartsActionSet.Deactivate(forSources); // Disable darts action set //defaultActionSet.Activate(forSources); } }
private void ActionSetStartViewEnabled(bool enabled) { if (_action_set_start_view != null) { if (enabled) { _action_set_start_view.Activate(); } else { _action_set_start_view.Deactivate(); } } }
private void Awake() { if (_gameStart) { return; } ExperimentManagerVariable = this; _locomotionManager = FindObjectOfType <LocomotionManager>(); _switchShader = FindObjectOfType <SwitchShader>(); _writeToFile = gameObject.AddComponent <WriteToFile>(); ActionSet.Activate(SteamVR_Input_Sources.Any, 0, true); _gameStart = true; }
private void updateLasersActionSetState() { if (!mainActionSet.IsActive()) { laserActionSet.Deactivate(); return; } if (laserActionSet.IsActive() && VRPlayer.activePointer == null) { laserActionSet.Deactivate(); } else if (!laserActionSet.IsActive() && VRPlayer.activePointer != null) { laserActionSet.Activate(SteamVR_Input_Sources.Any, 1 /* Higher priority than main action set */); } }
protected virtual void OnAttachedToHand(Hand hand) { if (activateActionSetOnAttach != null) { activateActionSetOnAttach.Activate(hand.handType); } if (onAttachedToHand != null) { onAttachedToHand.Invoke(hand); } if (skeletonPoser != null && hand.skeleton != null) { hand.skeleton.BlendToPoser(skeletonPoser, blendToPoseTime); } Debug.Log("ATTACHED"); attachedToHand = hand; }
protected virtual void OnAttachedToHand(IF_VR_Steam_Hand hand) { if (activateActionSetOnAttach != null) { activateActionSetOnAttach.Activate(hand.handType); } if (onAttachedToHand != null) { onAttachedToHand.Invoke(hand); } if (skeletonPoser != null && hand.skeleton != null) { hand.skeleton.BlendToPoser(skeletonPoser, blendToPoseTime); } attachedToHand = hand; }
protected virtual void OnAttachedToHand(Hand hand) { if (!string.IsNullOrEmpty(activateActionSetOnAttach.GetPath())) { activateActionSetOnAttach.Activate(hand.handType); } if (onAttachedToHand != null) { onAttachedToHand.Invoke(hand); } if (skeletonPoser != null && hand.skeleton != null) { hand.skeleton.BlendToPoser(skeletonPoser, blendToPoseTime); } attachedToHand = hand; }