Inheritance
System.Object
InputSystem
public class InputSystem : ComponentSystem
Fields
Declaration
protected InputData m_inputState
Field Value
Methods
Returns the input position in screen pixels. For touch input this is
the first touch. For mouse input, it is the mouse position.
Declaration
public float2 GetInputPosition()
Returns
Returns true if the key is currently held down.
Declaration
public bool GetKey(KeyCode key)
Parameters
Returns
Type |
Description |
System.Boolean |
|
Returns true if the key was pressed in the current frame.
Declaration
public bool GetKeyDown(KeyCode key)
Parameters
Returns
Type |
Description |
System.Boolean |
|
Returns true if the key was released in the current frame.
Declaration
public bool GetKeyUp(KeyCode key)
Parameters
Returns
Type |
Description |
System.Boolean |
|
Returns true if the mouse button is currently held down.
Declaration
public bool GetMouseButton(int button)
Parameters
Type |
Name |
Description |
System.Int32 |
button |
|
Returns
Type |
Description |
System.Boolean |
|
Returns true if the mouse button was pressed in the current frame.
Declaration
public bool GetMouseButtonDown(int button)
Parameters
Type |
Name |
Description |
System.Int32 |
button |
|
Returns
Type |
Description |
System.Boolean |
|
Returns true if the mouse button was released in the current frame.
Declaration
public bool GetMouseButtonUp(int button)
Parameters
Type |
Name |
Description |
System.Int32 |
button |
|
Returns
Type |
Description |
System.Boolean |
|
Retrieves information for a specific touch point. The index ranges
from 0 to the value returned by TouchCount.
Declaration
public Touch GetTouch(int index)
Parameters
Type |
Name |
Description |
System.Int32 |
index |
|
Returns
Convenience function that returns the value from GetInputPosition transformed
into world space. World space includes the camera transform of the camera
closest to the input position.
This is the same as TranslateScreenToWorld(GetInputPosition());
In 2D setups, the world z coordinate is always set to 0.
Declaration
public float3 GetWorldInputPosition()
Returns
Returns true if mouse events are emulated by other input devices, such as touch.
Declaration
public bool IsMouseEmulated()
Returns
Type |
Description |
System.Boolean |
|
Returns true if the current device produces mouse input.
Declaration
public bool IsMousePresent()
Returns
Type |
Description |
System.Boolean |
|
Returns true if the current device produces touch input responses.
This value may not be accurate until a first touch occurs.
Declaration
public bool IsTouchSupported()
Returns
Type |
Description |
System.Boolean |
|
Declaration
protected override void OnCreate()
Declaration
protected override void OnDestroy()
Declaration
protected override void OnUpdate()
Returns the number of currently active touches.
Declaration
Returns
Type |
Description |
System.Int32 |
|
Transforms Screen coordinates into World coordinates.
World space includes the camera transform of the camera closest to
the input coordinate.
In 2D setups, the world z coordinate is always set to 0.
Declaration
public float3 TranslateScreenToWorld(float2 screenCoord)
Parameters
Type |
Name |
Description |
float2 |
screenCoord |
|
Returns