예제 #1
0
 private void Awake()
 {
     rig = GetComponent <XRCustomRig>();
     if (rig != null)
     {
         hmd = rig.hmd;
     }
 }
예제 #2
0
    /// <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;
    }
예제 #3
0
    /// <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();
 }
예제 #5
0
 private void Awake()
 {
     rig = GetComponent <XRCustomRig>();
 }