Class BoneControl
Inherited Members
Namespace: UnityEngine .InputSystem .XR
Assembly: Unity.InputSystem.dll
Syntax
public class BoneControl : InputControl<Bone>
Properties
parentBoneIndex
Declaration
public IntegerControl parentBoneIndex { get; set; }
Property Value
Type | Description |
---|---|
Integer |
position
Declaration
public Vector3Control position { get; set; }
Property Value
Type | Description |
---|---|
Vector3Control |
rotation
Declaration
public QuaternionControl rotation { get; set; }
Property Value
Type | Description |
---|---|
Quaternion |
Methods
FinishSetup()
Perform final initialization tasks after the control hierarchy has been put into place.
Declaration
protected override void FinishSetup()
Overrides
Remarks
This method can be overridden to perform control- or device-specific setup work. The most common use case is for looking up child controls and storing them in local getters.
Examples
public class MyDevice : InputDevice
{
public ButtonControl button { get; private set; }
public AxisControl axis { get; private set; }
protected override void OnFinishSetup()
{
// Cache controls in getters.
button = GetChildControl("button");
axis = GetChildControl("axis");
}
}
ReadUnprocessedValueFromState(void*)
Read value from provided statePtr
.
Declaration
public override Bone ReadUnprocessedValueFromState(void* statePtr)
Parameters
Type | Name | Description |
---|---|---|
void* | statePtr | State pointer to read from. |
Returns
Type | Description |
---|---|
Bone | The controls current value. |
Overrides
Remarks
Read value from provided statePtr
without any caching.
See Also
WriteValueIntoState(Bone, void*)
Write a value into state at the given memory.
Declaration
public override void WriteValueIntoState(Bone value, void* statePtr)
Parameters
Type | Name | Description |
---|---|---|
Bone | value | Value for the control to store in the state. |
void* | statePtr | State containing the control's state |
Overrides
Remarks
Writing values will NOT apply processors to the given value. This can mean that when reading a value from a control after it has been written to its state, the resulting value differs from what was written.
Exceptions
Type | Condition |
---|---|
Not |
The control does not support writing. This is the case, for example, that compute values (such as the magnitude of a vector). |