docs.unity.cn
    Show / Hide Table of Contents

    Class SnapTurnProviderBase

    A locomotion provider that allows the user to rotate their rig using a 2D axis input.

    Inheritance
    Object
    LocomotionProvider
    SnapTurnProviderBase
    ActionBasedSnapTurnProvider
    DeviceBasedSnapTurnProvider
    Inherited Members
    LocomotionProvider.startLocomotion
    LocomotionProvider.beginLocomotion
    LocomotionProvider.endLocomotion
    LocomotionProvider.system
    LocomotionProvider.Awake()
    LocomotionProvider.CanBeginLocomotion()
    LocomotionProvider.BeginLocomotion()
    LocomotionProvider.EndLocomotion()
    Namespace: UnityEngine.XR.Interaction.Toolkit
    Syntax
    public abstract class SnapTurnProviderBase : LocomotionProvider

    Properties

    debounceTime

    The amount of time that the system will wait before starting another snap turn.

    Declaration
    public float debounceTime { get; set; }
    Property Value
    Type Description
    Single

    enableTurnAround

    Controls whether to enable 180° snap turns.

    Declaration
    public bool enableTurnAround { get; set; }
    Property Value
    Type Description
    Boolean
    See Also
    enableTurnLeftRight

    enableTurnLeftRight

    Controls whether to enable left and right snap turns.

    Declaration
    public bool enableTurnLeftRight { get; set; }
    Property Value
    Type Description
    Boolean
    See Also
    enableTurnAround

    turnAmount

    The number of degrees clockwise to rotate when snap turning clockwise.

    Declaration
    public float turnAmount { get; set; }
    Property Value
    Type Description
    Single

    Methods

    GetTurnAmount(Vector2)

    Determines the turn amount in degrees for the given input vector.

    Declaration
    protected virtual float GetTurnAmount(Vector2 input)
    Parameters
    Type Name Description
    Vector2 input

    Input vector, such as from a thumbstick.

    Returns
    Type Description
    Single

    Returns the turn amount in degrees for the given input vector.

    ReadInput()

    Reads the current value of the snap turn input.

    Declaration
    protected abstract Vector2 ReadInput()
    Returns
    Type Description
    Vector2

    Returns the input vector, such as from a thumbstick.

    StartTurn(Single)

    Begins turning locomotion.

    Declaration
    protected void StartTurn(float amount)
    Parameters
    Type Name Description
    Single amount

    Amount to turn.

    Update()

    See .

    Declaration
    protected void Update()
    Back to top Copyright © 2020 Unity Technologies
    Generated by DocFX
    on Wednesday, October 27, 2021