Interface ILunyInputService
- Namespace
- Luny.Engine.Services
/ - Assembly
- Luny.dll
Engine-agnostic input service providing event-driven and polling access to input actions.
public interface ILunyInputService : ILunyEngineService
Expand Details ...
Methods
void AssignUserToLastDevice(String userName, Int32 deviceId, ILunyObject lunyObject)
Parameters
void EnableInputAction(String actionName, Boolean enable)
Parameters
| Type |
Name |
Description |
- String
|
actionName |
|
- Boolean
|
enable |
|
Gets the analog trigger value (0.0–1.0) for the named button action.
Single GetAxis(String actionName)
Parameters
| Type |
Name |
Description |
- String
|
actionName |
|
Returns
- Single
True only on the frame the button transitioned to pressed.
Boolean GetButtonJustPressed(String actionName)
Parameters
| Type |
Name |
Description |
- String
|
actionName |
|
Returns
- Boolean
True while button is held.
Boolean GetButtonPressed(String actionName)
Parameters
| Type |
Name |
Description |
- String
|
actionName |
|
Returns
- Boolean
Returns a button's pressed strength. Used by triggers configured to act like buttons.
Single GetButtonStrength(String actionName)
Parameters
| Type |
Name |
Description |
- String
|
actionName |
|
Returns
- Single
Gets last known axis vector for the named action.
LunyVector2 GetDirection(String actionName)
Parameters
| Type |
Name |
Description |
- String
|
actionName |
|
Returns
- LunyVector2
Gets last known axis vector as rotation (quaternion). Assumes positive Y is up vector.
LunyQuaternion GetRotation(String actionName)
Parameters
| Type |
Name |
Description |
- String
|
actionName |
|
Returns
- LunyQuaternion
Gets last known axis vector as rotation (quaternion) with custom up vector.
LunyQuaternion GetRotation(String actionName, LunyVector3 worldUp)
Parameters
| Type |
Name |
Description |
- String
|
actionName |
|
- LunyVector3
|
worldUp |
|
Returns
- LunyQuaternion
Boolean IsUserPairedWithDevice(String userName, Int32 deviceId)
Parameters
| Type |
Name |
Description |
- String
|
userName |
|
- Int32
|
deviceId |
|
Returns
- Boolean
Activate a given control scheme eg Gamepad or Keyboard&Mouse to prevent other device input from coming through.
void SetControlSchemes(params String[] schemeNames)
Parameters
| Type |
Name |
Description |
- String[]
|
schemeNames |
|
void UnassignUser(String userName)
Parameters
| Type |
Name |
Description |
- String
|
userName |
|
Events
Fired when any enabled action changes value.
event Action<LunyInputActionEvent> OnInputAction
Event Type
- Action<LunyInputActionEvent>