Feel  3.16
The best way to improve your game's feel and make it extra juicy
MoreMountains.Tools.MMSwipeZone Class Reference

Add a swipe manager to your scene, and it'll trigger MMSwipeEvents everytime a swipe happens. From its inspector you can determine the minimal length of a swipe. Shorter swipes will be ignored More...

Inheritance diagram for MoreMountains.Tools.MMSwipeZone:

Public Member Functions

virtual void OnPointerDown (PointerEventData data)
 Triggers the bound pointer down action More...
 
virtual void OnPointerUp (PointerEventData data)
 Triggers the bound pointer up action More...
 
virtual void OnPointerEnter (PointerEventData data)
 Triggers the bound pointer enter action when touch enters zone More...
 
virtual void OnPointerExit (PointerEventData data)
 Triggers the bound pointer exit action when touch is out of zone More...
 

Public Attributes

float MinimalSwipeLength = 50f
 the minimal length of a swipe More...
 
float MaximumPressLength = 10f
 the maximum press length of a swipe More...
 
SwipeEvent ZoneSwiped
 The method(s) to call when the zone is swiped. More...
 
UnityEvent ZonePressed
 The method(s) to call while the zone is being pressed. More...
 
bool MouseMode = false
 If you set this to true, you'll need to actually press the button for it to be triggered, otherwise a simple hover will trigger it (better for touch input). More...
 

Protected Member Functions

virtual void Swipe ()
 Invokes a swipe event with the correct properties More...
 
virtual void Press ()
 Raises the press event More...
 
virtual MMPossibleSwipeDirections AngleToSwipeDirection (float angle)
 Determines a MMPossibleSwipeDirection out of an angle in degrees. More...
 

Protected Attributes

Vector2 _firstTouchPosition
 
float _angle
 
float _length
 
Vector2 _destination
 
Vector2 _deltaSwipe
 
MMPossibleSwipeDirections _swipeDirection
 
float _lastPointerUpAt = 0f
 
float _swipeStartedAt = 0f
 
float _swipeEndedAt = 0f
 

Detailed Description

Add a swipe manager to your scene, and it'll trigger MMSwipeEvents everytime a swipe happens. From its inspector you can determine the minimal length of a swipe. Shorter swipes will be ignored

Member Function Documentation

◆ AngleToSwipeDirection()

virtual MMPossibleSwipeDirections MoreMountains.Tools.MMSwipeZone.AngleToSwipeDirection ( float  angle)
protectedvirtual

Determines a MMPossibleSwipeDirection out of an angle in degrees.

Returns
The to swipe direction.
Parameters
angleAngle in degrees.

◆ OnPointerDown()

virtual void MoreMountains.Tools.MMSwipeZone.OnPointerDown ( PointerEventData  data)
virtual

Triggers the bound pointer down action

◆ OnPointerEnter()

virtual void MoreMountains.Tools.MMSwipeZone.OnPointerEnter ( PointerEventData  data)
virtual

Triggers the bound pointer enter action when touch enters zone

◆ OnPointerExit()

virtual void MoreMountains.Tools.MMSwipeZone.OnPointerExit ( PointerEventData  data)
virtual

Triggers the bound pointer exit action when touch is out of zone

◆ OnPointerUp()

virtual void MoreMountains.Tools.MMSwipeZone.OnPointerUp ( PointerEventData  data)
virtual

Triggers the bound pointer up action

◆ Press()

virtual void MoreMountains.Tools.MMSwipeZone.Press ( )
protectedvirtual

Raises the press event

◆ Swipe()

virtual void MoreMountains.Tools.MMSwipeZone.Swipe ( )
protectedvirtual

Invokes a swipe event with the correct properties

Member Data Documentation

◆ _angle

float MoreMountains.Tools.MMSwipeZone._angle
protected

◆ _deltaSwipe

Vector2 MoreMountains.Tools.MMSwipeZone._deltaSwipe
protected

◆ _destination

Vector2 MoreMountains.Tools.MMSwipeZone._destination
protected

◆ _firstTouchPosition

Vector2 MoreMountains.Tools.MMSwipeZone._firstTouchPosition
protected

◆ _lastPointerUpAt

float MoreMountains.Tools.MMSwipeZone._lastPointerUpAt = 0f
protected

◆ _length

float MoreMountains.Tools.MMSwipeZone._length
protected

◆ _swipeDirection

MMPossibleSwipeDirections MoreMountains.Tools.MMSwipeZone._swipeDirection
protected

◆ _swipeEndedAt

float MoreMountains.Tools.MMSwipeZone._swipeEndedAt = 0f
protected

◆ _swipeStartedAt

float MoreMountains.Tools.MMSwipeZone._swipeStartedAt = 0f
protected

◆ MaximumPressLength

float MoreMountains.Tools.MMSwipeZone.MaximumPressLength = 10f

the maximum press length of a swipe

◆ MinimalSwipeLength

float MoreMountains.Tools.MMSwipeZone.MinimalSwipeLength = 50f

the minimal length of a swipe

◆ MouseMode

bool MoreMountains.Tools.MMSwipeZone.MouseMode = false

If you set this to true, you'll need to actually press the button for it to be triggered, otherwise a simple hover will trigger it (better for touch input).

◆ ZonePressed

UnityEvent MoreMountains.Tools.MMSwipeZone.ZonePressed

The method(s) to call while the zone is being pressed.

◆ ZoneSwiped

SwipeEvent MoreMountains.Tools.MMSwipeZone.ZoneSwiped

The method(s) to call when the zone is swiped.


The documentation for this class was generated from the following file: