Class TouchPressControl
A button that reads its pressed state from phase.
Inherited Members
Namespace: UnityEngine.InputSystem.Controls
Assembly: Unity.InputSystem.dll
Syntax
public class TouchPressControl : ButtonControl
Remarks
This control is used by TouchControl to link press to phase. It will return 1 as long as the value of phase is Began, Stationary, or Moved, i.e. as long as the touch is in progress. For all other phases, it will return 0.
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.
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");
}
}</code></pre></example>
See Also
ReadUnprocessedValueFromState(void*)
Declaration
public override float ReadUnprocessedValueFromState(void* statePtr)
Parameters
Type | Name | Description |
---|---|---|
void* | statePtr |
Returns
Type | Description |
---|---|
float |
Overrides
See Also
WriteValueIntoState(float, void*)
Declaration
public override void WriteValueIntoState(float value, void* statePtr)
Parameters
Type | Name | Description |
---|---|---|
float | value | |
void* | statePtr |
Overrides
See Also
Extension Methods
InputControlExtensions.WriteValueIntoState<TValue, TState>(InputControl<TValue>, TValue, ref TState)