Class XRBodyTransformer
Behavior that manages user locomotion via transformation of an Origin. This behavior applies queued IXRBodyTransformations every Update().
Inherited Members
Namespace: UnityEngine.XR.Interaction.Toolkit.Locomotion
Assembly: solution.dll
Syntax
[AddComponentMenu("XR/Locomotion/XR Body Transformer", 11)]
[HelpURL("https://docs.unity.cn/Packages/com.unity.xr.interaction.toolkit@3.0/api/UnityEngine.XR.Interaction.Toolkit.Locomotion.XRBodyTransformer.html")]
[DefaultExecutionOrder(-205)]
public class XRBodyTransformer : MonoBehaviour
Properties
| Name | Description |
|---|---|
| bodyPositionEvaluator | Object supplied to transformations that determines the position of the user's body. If null on OnEnable(), this will be set to a shared instance of UnderCameraBodyPositionEvaluator. |
| constrainedBodyManipulator | Object supplied to transformations that can be used to perform movement that is constrained by collision (optional, may be null). |
| useCharacterControllerIfExists | If true and if a constrainedBodyManipulator is not already assigned, this behavior will check in OnEnable() if the Origin has a CharacterController. If so, it will set constrainedBodyManipulator to a shared instance of CharacterControllerBodyManipulator, so that the Character Controller is used to perform constrained movement. |
| xrOrigin | The XR Origin whose Origin to transform (will find one if null). |
Methods
| Name | Description |
|---|---|
| OnDisable() | See MonoBehaviour. |
| OnEnable() | See MonoBehaviour. |
| QueueTransformation(IXRBodyTransformation, int) | Queues a transformation to be applied during the next Update(). Transformations are applied
sequentially based on ascending |
| Reset() | See MonoBehaviour. |
| Update() | See MonoBehaviour. |
Events
| Name | Description |
|---|---|
| beforeApplyTransformations | Calls the methods in its invocation list every Update() before transformations are applied. |