Skip to content

NewUnityInputProvider

Source: Assets/UpscaleSDK/Core/Input/Runtime/Provider/NewInputSystem/NewUnityInputProvider.cs

class NewUnityInputProvider

Represents a new unity input provider class.

Events

public event Action<DeviceType> OnDeviceAdded

Occurs when device added.

public event Action<DeviceType> OnDeviceRemoved

Occurs when device removed.

Properties

public IInputPlayers Players

Methods

public void Initialize()

Initialize.

public void Dispose()

public bool ReadGamepadButton(int player, GamepadButton button)

Read button held. InputPlayer.Any reads every active player's gamepad.

Parameters

Name Description
player The player.
button The button.

public bool ReadGamepadButtonDown(int player, GamepadButton button)

Read button down.

Parameters

Name Description
player The player.
button The button.

public bool ReadGamepadButtonUp(int player, GamepadButton button)

Read button up.

Parameters

Name Description
player The player.
button The button.

public Vector2 Read2DGamepadAxis(int player, Gamepad2DAxis axis)

Read2 d axis. InputPlayer.Any takes the strongest player's value.

Parameters

Name Description
player The player.
axis The axis.

public float Read1DGamepadAxis(int player, Gamepad1DAxis axis)

Read1 d axis. InputPlayer.Any takes the strongest player's value.

Parameters

Name Description
player The player.
axis The axis.

public GamepadType GetGamepadType(int player = 0)

Gets the gamepad type of the player's own gamepad.

Parameters

Name Description
player The player.

public DeviceType[] GetConnectedDevices()

Gets the connected devices.

public bool ReadKeyboardKey(KeyboardKey keyboardKey)

Read keyboard key held.

public bool ReadKeyboardKeyDown(KeyboardKey keyboardKey)

Read keyboard key pressed this frame.

public bool ReadKeyboardKeyUp(KeyboardKey keyboardKey)

Read keyboard key released this frame.

public bool ReadMouseButton(MouseButton button)

Read mouse button held.

public bool ReadMouseButtonDown(MouseButton button)

Read mouse button pressed this frame.

public bool ReadMouseButtonUp(MouseButton button)

Read mouse button released this frame.

public float ReadMouse1DAxis(Mouse1DAxis axis)

Read mouse 1D axis.

public Vector2 ReadMouse2DAxis(Mouse2DAxis axis)

Read mouse 2D axis.

public void SetVibration(int player, float lowFreq, float highFreq)

Sets the vibration.

Parameters

Name Description
player The player; InputPlayer.Any vibrates every player's gamepad.
lowFreq The low freq.
highFreq The high freq.

public void StopVibration(int player = 0)

Stop vibration.

Parameters

Name Description
player The player; InputPlayer.Any stops every player's gamepad.