Class LocomotionProvider
The LocomotionProvider is the base class for various locomotion implementations. This class provides simple ways to interrogate the LocomotionSystem for whether a locomotion can begin and simple events for hooking into a start/end locomotion.
Inherited Members
Namespace: UnityEngine.XR.Interaction.Toolkit
Syntax
[DefaultExecutionOrder(-210)]
public abstract class LocomotionProvider : MonoBehaviour
Properties
locomotionPhase
The LocomotionPhase of this LocomotionProvider.
Declaration
public LocomotionPhase locomotionPhase { get; protected set; }
Property Value
Type | Description |
---|---|
LocomotionPhase |
Remarks
Each LocomotionProvider instance can implement LocomotionPhase options based on their own logic related to locomotion, such as input actions and frames during the animation.
See Also
system
The LocomotionSystem that this LocomotionProvider communicates with for exclusive access to an XR Origin. If one is not provided, the behavior will attempt to locate one during its Awake call.
Declaration
public LocomotionSystem system { get; set; }
Property Value
Type | Description |
---|---|
LocomotionSystem |
Methods
Awake()
See MonoBehaviour.
Declaration
protected virtual void Awake()
BeginLocomotion()
Invokes begin locomotion events.
Declaration
protected bool BeginLocomotion()
Returns
Type | Description |
---|---|
Boolean |
CanBeginLocomotion()
Checks if locomotion can begin.
Declaration
protected bool CanBeginLocomotion()
Returns
Type | Description |
---|---|
Boolean | Returns true if locomotion can start. Otherwise, returns false. |
EndLocomotion()
Invokes end locomotion events.
Declaration
protected bool EndLocomotion()
Returns
Type | Description |
---|---|
Boolean |
Events
beginLocomotion
Unity calls the beginLocomotion action when a LocomotionProvider successfully begins a locomotion event.
Declaration
public event Action<LocomotionSystem> beginLocomotion
Event Type
Type | Description |
---|---|
Action<LocomotionSystem> |
endLocomotion
Unity calls the endLocomotion action when a LocomotionProvider successfully ends a locomotion event.
Declaration
public event Action<LocomotionSystem> endLocomotion
Event Type
Type | Description |
---|---|
Action<LocomotionSystem> |
startLocomotion
(Deprecated) The startLocomotion action will be called when a LocomotionProvider successfully begins a locomotion event.
Declaration
[Obsolete("startLocomotion has been deprecated. Use beginLocomotion instead. (UnityUpgradable) -> beginLocomotion", true)]
public event Action<LocomotionSystem> startLocomotion
Event Type
Type | Description |
---|---|
Action<LocomotionSystem> |
Remarks
startLocomotion
has been deprecated. Use beginLocomotion instead.