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.
Namespace: UnityEngine.XR.Interaction.Toolkit
Syntax
public abstract class LocomotionProvider : MonoBehaviour
Properties
system
The LocomotionSystem that this LocomotionProvider will communicate with for exclusive access to an XR Rig. 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
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
The beginLocomotion action will be called when a LocomotionProvider successfully begins a locomotion event.
Declaration
public event Action<LocomotionSystem> beginLocomotion
Event Type
Type | Description |
---|---|
Action<LocomotionSystem> |
endLocomotion
The endLocomotion action will be called 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
public event Action<LocomotionSystem> startLocomotion
Event Type
Type | Description |
---|---|
Action<LocomotionSystem> |