void Start() { vrRig = transform.root.GetComponent <VRLocomotionRig>(); leftController = vrRig.s_handLeft.GetComponent <VRBasicController>(); rightController = vrRig.s_handRight.GetComponent <VRBasicController>(); agent = vrRig.GetComponent <NavMeshAgent>(); agent.speed = moveSpeed; }
void Start() { m_rootRef = transform.root; m_headRef = m_rootRef.GetComponent <VRLocomotionRig>().s_head; m_agent = m_rootRef.GetComponent <NavMeshAgent>(); m_leftController = m_rootRef.GetComponent <VRLocomotionRig>().s_handLeft.GetComponent <VRBasicController>(); m_rightController = m_rootRef.GetComponent <VRLocomotionRig>().s_handRight.GetComponent <VRBasicController>(); }
void Start() { leftController = transform.root.GetComponent <VRLocomotionRig>().s_handLeft.GetComponent <VRBasicController>(); rightController = transform.root.GetComponent <VRLocomotionRig>().s_handRight.GetComponent <VRBasicController>(); leftController.ropeTag = climbTag; rightController.ropeTag = climbTag; cont = transform.root.GetComponent <VRCharacterController>(); }
void Start() { SetUpRootTransform(); m_leftController = transform.root.GetComponent <VRLocomotionRig>().s_handLeft.GetComponent <VRBasicController>(); m_rightController = transform.root.GetComponent <VRLocomotionRig>().s_handRight.GetComponent <VRBasicController>(); m_agent = m_root.GetComponent <UnityEngine.AI.NavMeshAgent>(); m_vrCharCont = m_root.GetComponent <VRCharacterController>(); // StartCoroutine("RecalibrateOnTick"); StartCoroutine("TrackHeadsetVelocity"); }
void UpdateActiveController() { if (m_leftController.isTouching()) { m_activeController = m_leftController; } else if (m_rightController.isTouching()) { m_activeController = m_rightController; } else { m_activeController = null; } }
void Start() { gunContReference = transform.root.GetComponent <VRLocomotionRig>().s_handRight.GetComponent <VRBasicController>(); audioSource = transform.root.GetComponent <AudioSource>(); }
void Update() { switch (m_directionMode) { case eMoveDirectionMode.ACTIVE_CONTROLLER: { UpdateActiveController(); if (m_activeController == null) { break; } UpdateMove(); break; } case eMoveDirectionMode.LEFT_COTROLLER: { if (m_leftController.isTouching() || m_rightController.isTouching()) { m_activeController = m_leftController; } else { m_activeController = null; } if (m_activeController == null) { break; } UpdateMove(); break; } case eMoveDirectionMode.RIGHT_CONTROLLER: { if (m_leftController.isTouching() || m_rightController.isTouching()) { m_activeController = m_rightController; } else { m_activeController = null; } if (m_activeController == null) { break; } UpdateMove(); break; } case eMoveDirectionMode.GAZE: { UpdateActiveController(); if (m_activeController == null) { break; } UpdateMove(); break; } } }
void Start() { lineRenderer = GetComponent <LineRenderer>(); thisController = GetComponent <VRBasicController>(); }
void Update() { if (!disableButton) { if (!isToggle) { if (m_leftController.GetButtonDown((Valve.VR.EVRButtonId)buttonToPress)) { m_pressing = true; m_activeController = m_leftController; } else if (m_rightController.GetButtonDown((Valve.VR.EVRButtonId)buttonToPress)) { m_pressing = true; m_activeController = m_rightController; } if (m_pressing == true && (m_activeController.GetButtonUp((Valve.VR.EVRButtonId)buttonToPress))) { m_pressing = false; m_activeController = null; Debug.Log("Stop Tracking"); m_agent.velocity = Vector3.zero; #if UNITY_5_6 m_agent.isStopped = true; #else m_agent.Stop(); #endif m_bobState = BobState.STILL; } } else { if (m_leftController.GetButtonDown((Valve.VR.EVRButtonId)buttonToPress) || m_rightController.GetButtonDown((Valve.VR.EVRButtonId)buttonToPress)) { m_toggleOn = !m_toggleOn; } } } else { m_pressing = true; m_activeController = m_leftController; } if (isToggle) { if (m_toggleOn) { m_pressing = true; m_activeController = m_leftController; } else { m_pressing = false; m_activeController = null; m_agent.velocity = Vector3.zero; #if UNITY_5_6 m_agent.isStopped = true; #else m_agent.Stop(); #endif m_bobState = BobState.STILL; } } if (TrackingHeadbob()) { CheckForHeadBob(); } UpdateBobStates(); }