Interface IGravityController
Interface for external control over the GravityProvider. This interface should be implemented from a LocomotionProvider and be parented or attached to a LocomotionMediator.
Namespace: UnityEngine.XR.Interaction.Toolkit.Locomotion.Gravity
Assembly: Unity.XR.Interaction.Toolkit.dll
Syntax
public interface IGravityController
Properties
canProcess
Whether the gravity can be processed. Gravity controllers that can process receive queries to gravityPaused, controllers that cannot process do not.
Declaration
bool canProcess { get; }
Property Value
| Type | Description |
|---|---|
| bool |
Remarks
It's recommended to return isActiveAndEnabled when implementing this interface in a MonoBehaviour.
gravityPaused
Whether gravity is paused.
Declaration
bool gravityPaused { get; }
Property Value
| Type | Description |
|---|---|
| bool |
See Also
Methods
OnGravityLockChanged(GravityOverride)
Called from TryLockGravity(IGravityController, GravityOverride) when gravity lock is changed.
Declaration
void OnGravityLockChanged(GravityOverride gravityOverride)
Parameters
| Type | Name | Description |
|---|---|---|
| GravityOverride | gravityOverride | The GravityOverride to apply. |
See Also
OnGroundedChanged(bool)
Called from GravityProvider when the grounded state changes.
Declaration
void OnGroundedChanged(bool isGrounded)
Parameters
| Type | Name | Description |
|---|---|---|
| bool | isGrounded | Whether the player is on the ground. |
See Also
RemoveGravityLock()
Removes this provider from the GravityProvider list's of locked providers.
Declaration
void RemoveGravityLock()
TryLockGravity(GravityOverride)
Attempts to lock gravity.
Declaration
bool TryLockGravity(GravityOverride gravityOverride)
Parameters
| Type | Name | Description |
|---|---|---|
| GravityOverride | gravityOverride | The GravityOverride to apply. |
Returns
| Type | Description |
|---|---|
| bool | Whether the gravity was successfully locked. |