This is a preview release of upcoming changes.
This release has a lot of changed APIs, so upgrading from a previous version might be hard.
Please try it out with your use cases.
If no significant regressions are found, I'm going to publish it.https://github.com/TouchScript/TouchScr ... /9.0alpha1Minimum supported Unity version: 5.3.6
- Added: StandardLayer which replaces UI, 3D and 2D layers.
- Added: Proper Unity UI support, see Photos example.
- Added: Scroll wheel support.
- 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 and FLAG_RETURNED are implemented).
- Added: OverHelper component for handling hover/out events.
- Added: You can now turn off emulated mouse in mouse input.
- Added: Smoothing to Transformer.
- Added: Exit on ESC and automated adding scenes to Build Settings for examples.
- Changed: Windows 7/8/10 touch handling is moved to a C++ plugin, fixing crashes on quit.
- Removed: UIGesture, UICameraLayer, UIOverlayLayer, CameraLayer, CameraLayer2D. Use StandardLayer instead.
- Removed: MouseInput and MobileInput, use StandardInput instead.
- Removed: Tags.
- 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 points were updated.
- Fixed: TouchScriptInputModule and EventSystem initialization order.
- Fixed: Windows input not initializing if Unity window was in background while starting the app.
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.
- 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.
- 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.
- 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.