Dynamic Header Scripting Dark Center Band Scripting
Learn / Documentation / Script Reference / TouchDetector


class in Doozy.Engine.Touchy / Inherits from MonoBehaviour / Implements: IBeginDragHandlerCalculator, IDragHandler, IEndDragHandler


Responsible of capturing any inputs that are touch related and sending the touch info to all the relevant components. It also detects mouse inputs and converts them into simulated touches in order to help with tests in the Editor.

Static Properties

  • ?public static TouchDetector Instance – Returns a reference to the TouchDetector in the Scene. If one does not exist, it gets created.

  • ?public static bool ApplicationIsQuitting – Internal variable used as a flag when the application is quitting

  • ?public static bool DebugMode – Enables relevant debug messages to be printed to the console

  • ?public static float MinSwipeLength – Returns the minimum swipe distance in order for a touch to be considered a swipe

  • ?public static float LongTapDuration – Returns the time period needed for a finger to be touching the target device, in order for the tap to be considered a long tap (long press)


  • ?public bool TouchInProgress – Returns TRUE if a touch is in progress

  • ?public TouchInfo CurrentTouchInfo – If a touch is in progress, it returns its touch info

Public Variables

  • ?public Action<TouchInfo> OnTapAction – Action triggered when a tap is detected

  • ?public Action<TouchInfo> OnLongTapAction – Action triggered when a long tap is detected

  • ?public Action<TouchInfo> OnSwipeAction – Action triggered when a swipe is detected

Public Methods

  • ?public void SetDraggedObject(GameObject target) – Sets a new dragged target

Static Methods