This release has a lot of changed APIs, so upgrading from a previous version might be hard.
Minimum supported Unity version: 5.6.0
CHANGES
- Added: Settings window (Window > TouchScript > Settings) with links to docs and script defines.
- Added: Proper Unity UI support, see Photos example.
- Added: Unity Events support.
- Added: StandardLayer which replaces UI, 3D and 2D layers.
- Added: Scroll wheel support.
- Added: Pressure and Rotation properties for pen and touch pointers.
- Added: Basic and Advanced views to most components. Basic view only shows most important parameters.
- Added: A possibility to set transforms to exclusively receive input with LayerManager.SetExclusive() API.
- Added: OverHelper component for handling hover/out events.
- Added: Ability turn off emulated mouse in mouse input.
- Added: Smoothing to Transformer.
- Added: New editor interface for components.
- Added: Pointer.Buttons to be able to detect which buttons of the controller are pressed and released.
- Added: Pointer.GetOverData() which returns TouchHit for whatever is under the pointer.
- Added: Pointer.Flags (right now FLAG_ARTIFICIAL, FLAG_RETURNED and FLAG_INTERNAL are implemented).
- Added: Exit on ESC and automated adding scenes to Build Settings for examples.
- Added: EditorResources to handle editor-only images.
- Added: Different pointer types support to Cursor Manager (was Pointer Visualizer), cursor gradients are now customizable.
- Added: Debug mode to record pointers in editor and player.
- Added: Profiler markers throughout the code base.
- Added: Recognized gestures can now be cancelled.
- Added: Icons to scripts.
- Changed: Windows 7/8/10 touch handling is moved to a C++ plugin, fixing crashes on quit.
- Changed: Mouse fake pointer is now created right when ALT+PRESS happens and not the next frame after ALT+RELEASE. The former method was triggering unnecessary taps and was interfering with other gestures.
- Changed: By default StandardLayer now raycasts everything.
- Changed: Moved TouchScript.prefab and Cursors.prefab into Prefabs folder from Examples folder.
- Removed: UIGesture, UICameraLayer, UIOverlayLayer, CameraLayer, CameraLayer2D. Use StandardLayer instead.
- Removed: MouseInput and MobileInput, use StandardInput instead.
- Removed: Tags.
- Removed: WebPlayer from the code base.
FIXES
- Fixed: Layer list on TouchManager not updating in play mode.
- Fixed: Using nonalloc API for CameraLayer and CameraLayer2D functionality in StandardInput.
- Fixed: Defines for 5.4+.
- Fixed: All pointers now are reset even if no pointers were updated.
- Fixed: TouchScriptInputModule and EventSystem initialization order.
- Fixed: Windows input not initializing if Unity window was in background while starting the app.
- Fixed: Dependency on VC++ redistributable in Windows builds.
- Fixed: Dependency on GetPointerInfo Windows 8 API in WindowsTouch.dll.
- Fixed: Windows 8 pen interaction.
- Fixed: Windows issue with wrong input values when resolution changes.
- Fixed: Occasional frozen touches on Windows.
- Fixed: An issue with multi-finger gestures failing.
- Fixed: Visualization of multiple fingers.
- Fixed: TapGesture erroneously triggering because of a redispatched touch from 2+ point gestures.
- Fixed: Layer initialization order. Giving one more frame before we create a StandardLayer if no layers present.
- Fixed: Warnings and errors in in 5.5, 5.6 and 2017.1.
- Fixed: Issues with simultaneous usage of mouse and touch for Windows 7 / Unity touch inputs.
- Fixed: Interaction with UI Masks.
- Fixed: Mouse scroll value not resetting when no scroll occurs.
- Fixed: Delta values in Transform Gestures not resetting after Changed event.
- Fixed: Standard Layer ticking UI when UI recognition is disabled.
- Fixed: Issues with Time.timeScale = 0.
- Fixed: Gesture dispatch performance in transforms hierarchy (it's much faster now, yey!).
- Fixed: DPI calculations.
- Fixed: Issues with debug cursors in builds.
- Fixed: A rare null pointer exception in LongPressGesture.
- Fixed: Transformer not working with other components modifying object's TRS.
- Fixed: UI events processing — updates are no longer processed if not over a UI element, or not pressed a UI element.
IMPORTANT API CHANGES:
- Renamed: touch to pointer in the whole code base.
- Added: 4 types of pointers: Touch, Mouse, Pen, Object.
- Added: Idle state to gestures which is active until gesture started recognizing the sequence (at this point it goes to Possible).
- Changed: Now instead of Began, Moved, Ended, Cancelled pointer events there are Added, Pressed, Updated, Released, Removed and Cancelled events to work with hovering pointers like mouse.
- Removed: ITouchManager.GetHitTarget API. This functionality is replaced by IPointer.GetOverData, PointerUtils.IsPointerOnTarget.
API CHANGES
- Added: IPointer interface. LayerDelegate, TouchLayer, HitTest accept IPointer instead of Pointer.
- Added: PressedPointers and PressedPointersCount since (Active)Pointers now contain hovering pointers and need to be differentiated from pressed pointers.
- Added: Pools to mouse and pen handlers since when cancelled and returned touches must be different. I.e mouse has a pool of 1 object.
- Added: Pointer.CopyFrom.
- Added: Pointers are now created with a reference to the input source they belong to.
- Added: ITransformGesture.TransformMask with set flags for what actually changed.
- Added: TouchScriptInputModule.IsPointerOverGameObject implementation.
- Changed: MouseHandler, TouchHandler, Win*TouchHandler now have CoordinatesRemapper property and do remapping themselves via the remapper passed from StandardInput.
- Changed: All *PointerDelegate to PointerDelegate: addPointer, updatePointer and others now accept just a Pointer object. All input sources must update relevant touch parameters themselves before calling updatePointer.
- Changed: Touch/Mouse/Windows handlers are now IInputSource and manage their pointers themselves.
- Changed: ObjectPool now requires a function which creates elements.
- Changed: Transform gestures namespace and hierarchy.
- Changed: Transformer.smoothingFactor max to 100000.
- Changed: Gesture.ScreenPosition now returns activePointers[0].Position.
- Moved: Layer registration logic to LayerManager.
- Moved: CombineTouches functionality from Gesture to TapGesture since it is the only place it is used.
- Moved: Pointer class to Pointers namespace.
- Moved: Pointer Target, Hit, Layer to TouchHit structure obtainable through GetPressData().
- Moved: Pointer cache logic to inputs.
- Merged: ObjectHitResult and LayerHitResult into HitResult.
- Renamed: ActivePointers to Pointers, NumberOfPointers to PointersCount.
- Renamed: TouchHit.Transform to Target.
- Renamed: Gesture.ScreenPositionHitData to GetScreenPositionHitData().
- Renamed: TouchHit.PointerHitType to HitType.
- Renamed: TouchHit to HitData.
- Renamed: Gesture.ScreenPosition to ScreenPositionHit.
- Renamed: Clusters to Clusters2D.
- Renamed: TouchScript.Debug namespace to TouchScript.DebugUtils.
- Removed: Gesture.GetTargetHitResult, added Gesture.ScreenPositionHit property.
- Removed: HitResult.Error.
- Removed: One overload of ITouchManager.GetHitTarget.
- Removed: ITransformGesture.ApplyTransform, Transformer component now applies changes itself.