Class LunyInputServiceBase
- Namespace
- Luny.Engine.Services
/ - Assembly
- Luny.dll
public abstract class LunyInputServiceBase : LunyEngineServiceBase, ILunyInputService, ILunyEngineService
Expand Details ...
- Inheritance
-
Object
LunyInputServiceBase
- Implements
-
- Derived
-
- Inherited Members
-
Constructors
protected LunyInputServiceBase()
Properties
protected LunyInputActionEvent LastInputEvent { get; }
Property Value
- LunyInputActionEvent
Methods
public abstract void AssignUserToLastDevice(String userName, Int32 deviceId, ILunyObject lunyObject)
Parameters
public abstract 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.
public Single GetAxis(String actionName)
Parameters
| Type |
Name |
Description |
- String
|
actionName |
|
Returns
- Single
True only on the frame the button transitioned to pressed.
public Boolean GetButtonJustPressed(String actionName)
Parameters
| Type |
Name |
Description |
- String
|
actionName |
|
Returns
- Boolean
True while button is held.
public 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.
public Single GetButtonStrength(String actionName)
Parameters
| Type |
Name |
Description |
- String
|
actionName |
|
Returns
- Single
Gets last known axis vector for the named action.
public LunyVector2 GetDirection(String actionName)
Parameters
| Type |
Name |
Description |
- String
|
actionName |
|
Returns
- LunyVector2
protected LunyInputActionEvent GetOrCreateInputActionEvent(String actionName)
Parameters
| Type |
Name |
Description |
- String
|
actionName |
|
Returns
- LunyInputActionEvent
Gets last known axis vector as rotation (quaternion). Assumes positive Y is up vector.
public LunyQuaternion GetRotation(String actionName)
Parameters
| Type |
Name |
Description |
- String
|
actionName |
|
Returns
- LunyQuaternion
Gets last known axis vector as rotation (quaternion) with custom up vector.
public LunyQuaternion GetRotation(String actionName, LunyVector3 worldUp)
Parameters
| Type |
Name |
Description |
- String
|
actionName |
|
- LunyVector3
|
worldUp |
|
Returns
- LunyQuaternion
protected void HandleInputActionEvent(LunyInputActionEvent inputEvent)
Parameters
public abstract Boolean IsUserPairedWithDevice(String userName, Int32 deviceId)
Parameters
| Type |
Name |
Description |
- String
|
userName |
|
- Int32
|
deviceId |
|
Returns
- Boolean
protected override void OnServiceFrameBegins()
Clears per-frame transition flags. Called at the start of each frame via OnServicePreUpdate.
protected override void OnServiceFrameEnds()
protected void SetAxisInput(String actionName, Single value)
Parameters
| Type |
Name |
Description |
- String
|
actionName |
|
- Single
|
value |
|
protected void SetButtonInput(String actionName, Boolean pressed, Single strength = 1)
Parameters
| Type |
Name |
Description |
- String
|
actionName |
|
- Boolean
|
pressed |
|
- Single
|
strength |
|
Activate a given control scheme eg Gamepad or Keyboard&Mouse to prevent other device input from coming through.
public abstract void SetControlSchemes(params String[] schemeNames)
Parameters
| Type |
Name |
Description |
- String[]
|
schemeNames |
|
protected void SetDirectionalInput(String actionName, LunyVector2 value)
Parameters
| Type |
Name |
Description |
- String
|
actionName |
|
- LunyVector2
|
value |
|
public abstract void UnassignUser(String userName)
Parameters
| Type |
Name |
Description |
- String
|
userName |
|
Events
Fired when any enabled action changes value.
public event Action<LunyInputActionEvent> OnInputAction
Event Type
- Action<LunyInputActionEvent>