Class InputWrapper
Interface to the Input system used by the BaseInputModule. With this it is possible to bypass the Input system with your own but still use the same InputModule. For example this can be used to feed fake input into the UI or interface with a different input system.
Namespace: UnityEngine.UIElements
Syntax
public class InputWrapper : MonoBehaviour
Properties
compositionCursorPos
Interface to Input.compositionCursorPos. Can be overridden to provide custom input instead of using the Input class.
Declaration
public virtual Vector2 compositionCursorPos { get; set; }
Property Value
Type | Description |
---|---|
Vector2 |
compositionString
Interface to Input.compositionString. Can be overridden to provide custom input instead of using the Input class.
Declaration
public virtual string compositionString { get; }
Property Value
Type | Description |
---|---|
String |
imeCompositionMode
Interface to Input.imeCompositionMode. Can be overridden to provide custom input instead of using the Input class.
Declaration
public virtual IMECompositionMode imeCompositionMode { get; set; }
Property Value
Type | Description |
---|---|
IMECompositionMode |
mousePosition
Interface to Input.mousePosition. Can be overridden to provide custom input instead of using the Input class.
Declaration
public virtual Vector2 mousePosition { get; }
Property Value
Type | Description |
---|---|
Vector2 |
mousePresent
Interface to Input.mousePresent. Can be overridden to provide custom input instead of using the Input class.
Declaration
public virtual bool mousePresent { get; }
Property Value
Type | Description |
---|---|
Boolean |
mouseScrollDelta
Interface to Input.mouseScrollDelta. Can be overridden to provide custom input instead of using the Input class.
Declaration
public virtual Vector2 mouseScrollDelta { get; }
Property Value
Type | Description |
---|---|
Vector2 |
touchCount
Interface to Input.touchCount. Can be overridden to provide custom input instead of using the Input class.
Declaration
public virtual int touchCount { get; }
Property Value
Type | Description |
---|---|
Int32 |
touchSupported
Interface to Input.touchSupported. Can be overridden to provide custom input instead of using the Input class.
Declaration
public virtual bool touchSupported { get; }
Property Value
Type | Description |
---|---|
Boolean |
Methods
GetAxisRaw(String)
Interface to Input.GetAxisRaw. Can be overridden to provide custom input instead of using the Input class.
Declaration
public virtual float GetAxisRaw(string axisName)
Parameters
Type | Name | Description |
---|---|---|
String | axisName | Axis name to check |
Returns
Type | Description |
---|---|
Single | Returns the value of the virtual axis identified by axisName with no smoothing filtering applied. |
GetButtonDown(String)
Interface to Input.GetButtonDown. Can be overridden to provide custom input instead of using the Input class.
Declaration
public virtual bool GetButtonDown(string buttonName)
Parameters
Type | Name | Description |
---|---|---|
String | buttonName | Button name to get |
Returns
Type | Description |
---|---|
Boolean | Returns true during the frame the user pressed down the virtual button identified by buttonName. |
GetMouseButton(Int32)
Interface to Input.GetMouseButton. Can be overridden to provide custom input instead of using the Input class.
Declaration
public virtual bool GetMouseButton(int button)
Parameters
Type | Name | Description |
---|---|---|
Int32 | button | The button id. Values are 0 for left button, 1 for right button, 2 for the middle button. |
Returns
Type | Description |
---|---|
Boolean | Returns whether the given mouse button is held down. |
GetMouseButtonDown(Int32)
Interface to Input.GetMouseButtonDown. Can be overridden to provide custom input instead of using the Input class.
Declaration
public virtual bool GetMouseButtonDown(int button)
Parameters
Type | Name | Description |
---|---|---|
Int32 | button | The button id. Values are 0 for left button, 1 for right button, 2 for the middle button. |
Returns
Type | Description |
---|---|
Boolean | Returns true during the frame the user pressed the given mouse button. |
GetMouseButtonUp(Int32)
Interface to Input.GetMouseButtonUp. Can be overridden to provide custom input instead of using the Input class.
Declaration
public virtual bool GetMouseButtonUp(int button)
Parameters
Type | Name | Description |
---|---|---|
Int32 | button | The button id. Values are 0 for left button, 1 for right button, 2 for the middle button. |
Returns
Type | Description |
---|---|
Boolean | Returns true during the frame the user releases the given mouse button. |
GetTouch(Int32)
Interface to Input.GetTouch. Can be overridden to provide custom input instead of using the Input class.
Declaration
public virtual Touch GetTouch(int index)
Parameters
Type | Name | Description |
---|---|---|
Int32 | index | Touch index to get |
Returns
Type | Description |
---|---|
Touch | Touch details. |