namespace UnityEngine.XR.Interaction.Toolkit.Locomotion
{
///
/// The state of locomotion for any given .
///
public enum LocomotionState
{
///
/// Locomotion state where the is idle, before locomotion input occurs.
///
Idle,
///
/// Locomotion state where the is getting ready to move, when locomotion start
/// input occurs.
///
///
/// The provider enters this state after calling . It remains
/// in this state until it enters the state, which happens either when the
/// provider calls or during the
/// 's next in which
/// is , whichever happens first.
///
Preparing,
///
/// Locomotion state where the is queuing s
/// with the .
///
///
/// The provider can enter this state in one of two ways:
/// 1. From the state, the first time
/// is during any of the
/// 's calls after the
/// provider called , or
/// 2. From any state other than , immediately after the provider called
/// .
///
Moving,
///
/// Locomotion state where the is no longer moving, after locomotion end input
/// has completed.
///
///
/// The provider enters this state after calling , and it
/// remains in this state until it returns to the state during the
/// 's in the next frame.
///
Ended,
}
///
/// Extension methods for .
///
public static class LocomotionStateExtensions
{
///
/// Whether this is the state of actively preparing or performing locomotion. This returns
/// if is or ,
/// otherwise.
///
/// The locomotion state to check.
/// Returns if is or
/// , otherwise.
public static bool IsActive(this LocomotionState state)
{
return state == LocomotionState.Preparing || state == LocomotionState.Moving;
}
}
}