private void Awake() { rig = GetComponent <XRCustomRig>(); if (rig != null) { hmd = rig.hmd; } }
/// <summary> /// This function teleports the player, /// by changing the position of the rig into hit point position. /// and uses the haptic function from XRCustomRig. /// </summary> void Teleport() { if (control.usingControllers) { XRCustomRig.Haptic(control.rig.GetControllerDevice(control.preferredHand), 0.5f, 0.1f); } control.rig.transform.position = hit.point; }
/// <summary> /// This function double checks the settings after the rig is initialized. /// </summary> /// <param name="rig">XRCustomRig</param> /// <returns></returns> public GameSettings CheckTheSettings(XRCustomRig rig) { if (!rig.hasControllers) { if (settings.ControllersInUse == true) { Debug.Log("No controllers presence detected, changing settings!"); settings.ControllersInUse = false; settings.PreferredHand = PreferredHand.Hmd; } } return(settings); }
private void Awake() { rig = GetComponent <XRCustomRig>(); InitMovementStyles(); }
private void Awake() { rig = GetComponent <XRCustomRig>(); }