Class IntegerControl
A generic input control reading integer values.
Inherited Members
Namespace: UnityEngine .InputSystem .Controls
Assembly: Unity.InputSystem.dll
Syntax
public class IntegerControl : InputControl<int>
Constructors
IntegerControl()
Default-initialize an integer control.
Declaration
public IntegerControl()
Methods
CalculateOptimizedControlDataType()
Calculates and returns an optimized data type that can represent a control's value in memory directly.
Declaration
protected override FourCC CalculateOptimizedControlDataType()
Returns
Type | Description |
---|---|
Four |
An optimized data type that can represent a control's value in memory directly. Input |
Overrides
Remarks
The value then is cached in optimized
ReadUnprocessedValueFromState(void*)
Read value from provided statePtr
.
Declaration
public override int ReadUnprocessedValueFromState(void* statePtr)
Parameters
Type | Name | Description |
---|---|---|
void* | statePtr | State pointer to read from. |
Returns
Type | Description |
---|---|
int | The controls current value. |
Overrides
Remarks
Read value from provided statePtr
without any caching.
See Also
WriteValueIntoState(int, void*)
Write a value into state at the given memory.
Declaration
public override void WriteValueIntoState(int value, void* statePtr)
Parameters
Type | Name | Description |
---|---|---|
int | 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). |