0.9.1-preview #
Fixed
Changed
Added
Fixed
- Fixed GC heap garbage being caused by triggered by event processing.
- This meant that every processing of input would trigger garbage being allocated on the managed heap. The culprit was a peculiarity in the C# compiler which caused a struct in
InputEventPtr.IsA
to be allocated on the heap.
- This meant that every processing of input would trigger garbage being allocated on the managed heap. The culprit was a peculiarity in the C# compiler which caused a struct in
- The bindings selection popup window will now show child controls matching the current action type even if the parent control does not match.
- Fixed
duration
values reported for Hold and Press interactions. - DualShock 3 on macOS:
- Fixed actions bound to the dpad control performing correctly.
- Fixed non-present touchpad button control being triggered incorrectly.
- Fixed compile issues with switch classes on standalone Linux.
- Leak of unmanaged memory in
InputControlList
.
Actions
- Fixed actions not updating their set of controls when the usages of a device are changed.
- Composite bindings with the default interaction will now correctly cancel when the composite is released, even if there are multiple composite bindings on the action.
Changed
MouseState
,KeyboardState
, andGamepadState
have been made public again.PlayerInput
andPlayerInputManager
have been moved from theUnityEngine.InputSystem.PlayerInput
namespace toUnityEngine.InputSystem
.- The signature of
InputSystem.onEvent
has changed. The callback now takes a second argument which is the device the given event is sent to (null if there's no correspondingInputDevice
).// Before: InputSystem.onEvent += eventPtr => { var device = InputSystem.GetDeviceById(eventPtr.deviceId); //... }; // Now: InputSystem.onEvent += (eventPtr, device) => { //... };
- The signatures of
InputSystem.onBeforeUpdate
andInputSystem.onAfterUpdate
have changed. The callbacks no longer receive anInputUpdateType
argument.- Use
InputState.currentUpdateType
in case you need to know the type of update being run.
- Use
InputUpdateType
has been moved to theUnityEngine.InputSystem.LowLevel
namespace.InputSystem.Update(InputUpdateType)
has been removed from the public API.- The way input devices are built internally has been streamlined.
InputDeviceBuilder
is now internal. It is no longer necessary to access it to look up child controls. Simply useInputControl.GetChildControl
instead.- To build a device without adding it to the system, call the newly added
InputDevice.Build
method.InputDevice.Build<Mouse>();
InputSystem.SetLayoutVariant
has been removed. Layout variants can no longer be set retroactively but must be decided on as part of device creation.
InputSystem.RegisterControlProcessor
has been renamed to justInputSystem.RegisterProcessor
.
Actions
InputAction.ReadValue<TValue>()
is longer correlated toInputAction.triggered
. It simply returns the current value of a bound control or composite while the action is being interacted with.InputInteractionContext.PerformedAndGoBackToWaiting
has been renamed to justInputInteractionContext.Performed
.
Actions
- Individual composite part bindings can now no longer have interactions assigned to them as that never made any sense.
Added
- Devices can now have more than one usage.
- Call
InputSystem.AddDeviceUsage(device,usage)
to add additional usages to a device. - Call
InputSystem.RemoveDeviceUsage(device,usage)
to remove existing usages from a device. InputSystem.SetDeviceUsage(device,usage)
still exists. It will clear all existing usages from the given device.
- Call
- A new
VisualizerSamples
sample that can be installed through the package manager.- Contains two components
InputControlVisualizer
andInputActionVisualizer
that help visualizing/debugging control/device and action activity through in-game overlays. A few sample scenes illustrate how to use them.
- Contains two components
Actions
- Added
InputAction.ReadValueAsObject
API. - Added
InputAction.activeControl
API.