C# Class EasyTouch, CapsUnity

This is the main class of Easytouch engine. For add Easy Touch to your scene It is a fake singleton, so you can simply access their settings via a script with all static methods or with the inspector.
Inheritance: MonoBehaviour
Show file Open project: kofight/CapsUnity Class Usage Examples

Public Properties

Property Type Description
StationnaryTolerance float
autoSelect bool
enable bool
enable2FingersGesture bool
enablePinch bool
enableRemote bool
enableReservedArea bool
enableTwist bool
enabledNGuiMode bool
instance EasyTouch,
isExtension bool
longTapTime float
minPinchLength float
minTwistAngle float
nGUICameras List
nGUILayers LayerMask
pickableLayers LayerMask
receiverObject GameObject
reservedAreas List
reservedGuiAreas List
reservedVirtualAreas List
secondFingerTexture Texture
showGeneral bool
showGesture bool
showSecondFinger bool
showSelect bool
showTwoFinger bool
swipeKey KeyCode,
swipeTolerance float
touchCameras List
twistKey KeyCode,
useBroadcastMessage bool

Public Methods

Method Description
AddReservedArea ( Rect rec ) : void

Adds a reserved area.

AddReservedGuiArea ( Rect rec ) : void
EasyTouch ( ) : UnityEngine
GetCamera ( int index ) : Camera

Return the camera used by EasyTouch for the auto-selection.

GetCurrentPickedObject ( int fingerIndex ) : GameObject

Gets the current picked object under a specific touch

GetEnable2FingersGesture ( ) : bool

Return if 2 fingers gesture is enabled or disabled

GetEnableAutoSelect ( ) : bool

Return if auto select is enabled or disabled

GetEnablePinch ( ) : bool

Return if 2 pinch gesture is enabled or disabled

GetEnableTwist ( ) : bool

Return if 2 twist gesture is enabled or disabled

GetEnabled ( ) : bool

Return if EasyTouch is enabled or disabled.

GetFingerPosition ( int fingerIndex ) : Vector2

Gets the a specific finger position.

GetIsReservedArea ( ) : bool

Return if Reserved Area is enable or disable

GetMinPinchLength ( ) : float

Return the minimum length of the pinch.

GetMinTwistAngle ( ) : float

Gets the minimum twist angle.

GetOtherReceiverObject ( ) : GameObject

Return the other event receiver.

GetPickableLayer ( ) : LayerMask

Gets the pickable layer.

GetStationnaryTolerance ( ) : float

Return the stationnary tolerance.

GetSwipeTolerance ( ) : float

Return the swipe tolerance.

GetTouchCount ( ) : int

Return the current touches count.

GetlongTapTime ( ) : float

Return the longs the tap time.

InitEasyTouch ( ) : void
IsRectUnderTouch ( Rect rect, bool guiRect = false ) : bool

Determines if a touch is under a specified rect guiRect.

OnDrawGizmos ( ) : void
OnEnable ( ) : void
OnGUI ( ) : void
RemoveReservedArea ( Rect rec ) : void

Removes a reserved area.

RemoveReservedGuiArea ( Rect rec ) : void
ResetTouch ( int fingerIndex ) : void

Resets a specific touch.

ResetTouches ( ) : void
SetCamera ( Camera cam, bool guiCam = false ) : void

Sets the camera uses by EasyTouch to linePick for auto-selection.

SetEnable2FingersGesture ( bool enable ) : void

Enables or disables the recognize of 2 fingers gesture.

SetEnableAutoSelect ( bool enable ) : void

Enables or disables auto select.

SetEnablePinch ( bool enable ) : void

Enables or disables the recognize of pinch gesture

SetEnableTwist ( bool enable ) : void

Enables or disables the recognize of twist gesture

SetEnabled ( bool enable ) : void

Enables or disables Easy Touch.

SetIsReservedArea ( bool enable ) : void

Sets if Reserved Area is enable or disable

SetMinPinchLength ( float length ) : void

Sets the minimum length of the pinch.

SetMinTwistAngle ( float angle ) : void

Sets the minimum twist angle.

SetOtherReceiverObject ( GameObject receiver ) : void

Sets the other receiver for EasyTouch event.

SetPickableLayer ( LayerMask mask ) : void

Sets the pickable layer.

SetStationnaryTolerance ( float tolerance ) : void

Sets the stationnary tolerance.

SetSwipeTolerance ( float tolerance ) : void

Sets the swipe tolerance.

SetlongTapTime ( float time ) : void

Set the long tap time in second

Start ( ) : void
Update ( ) : void
UpdateTouches ( bool realTouch, int touchCount ) : void

Private Methods

Method Description
CreateGesture ( int touchIndex, EventName, message, Finger, finger, float actionTime, SwipeType swipe, float swipeLength, Vector2 swipeVector ) : void
CreateGesture2Finger ( EventName, message, Vector2 startPosition, Vector2 position, Vector2 deltaPosition, float actionTime, SwipeType swipe, float swipeLength, Vector2 swipeVector, float twist, float pinch, float twoDistance ) : void
CreateStateEnd2Fingers ( GestureType gesture, Vector2 startPosition, Vector2 position, Vector2 deltaPosition, float time, bool realEnd, float fingerDistance ) : void
DeltaAngle ( Vector2 start, Vector2 end ) : float
FingerInTolerance ( Finger, finger ) : bool
GetFinger ( int finderId ) : Finger,
GetPickeGameObject ( Finger, &finger, bool twoFinger = false ) : bool
GetSwipe ( Vector2 start, Vector2 end ) : SwipeType
GetTwoFinger ( int index ) : int
IsTouchHoverNGui ( int touchIndex ) : bool
IsTouchReservedArea ( int touchIndex ) : bool
OneFinger ( int fingerIndex ) : void
RaiseEvent ( EventName, evnt, Gesture, gesture ) : void
RaiseReadyEvent ( ) : void
SendGesture ( EventName, message, Gesture, gesture ) : void
SendGesture2Finger ( EventName, message, Gesture, gesture ) : void
TwistAngle ( ) : float
TwoFinger ( ) : void

Method Details

AddReservedArea() public static method

Adds a reserved area.
public static AddReservedArea ( Rect rec ) : void
rec Rect /// Rec. ///
return void

AddReservedGuiArea() public static method

public static AddReservedGuiArea ( Rect rec ) : void
rec Rect
return void

EasyTouch() public method

public EasyTouch ( ) : UnityEngine
return UnityEngine

GetCamera() public static method

Return the camera used by EasyTouch for the auto-selection.
public static GetCamera ( int index ) : Camera
index int
return Camera

GetCurrentPickedObject() public static method

Gets the current picked object under a specific touch
public static GetCurrentPickedObject ( int fingerIndex ) : GameObject
fingerIndex int /// Finger index. ///
return GameObject

GetEnable2FingersGesture() public static method

Return if 2 fingers gesture is enabled or disabled
public static GetEnable2FingersGesture ( ) : bool
return bool

GetEnableAutoSelect() public static method

Return if auto select is enabled or disabled
public static GetEnableAutoSelect ( ) : bool
return bool

GetEnablePinch() public static method

Return if 2 pinch gesture is enabled or disabled
public static GetEnablePinch ( ) : bool
return bool

GetEnableTwist() public static method

Return if 2 twist gesture is enabled or disabled
public static GetEnableTwist ( ) : bool
return bool

GetEnabled() public static method

Return if EasyTouch is enabled or disabled.
public static GetEnabled ( ) : bool
return bool

GetFingerPosition() public static method

Gets the a specific finger position.
public static GetFingerPosition ( int fingerIndex ) : Vector2
fingerIndex int /// Finger index. ///
return Vector2

GetIsReservedArea() public static method

Return if Reserved Area is enable or disable
public static GetIsReservedArea ( ) : bool
return bool

GetMinPinchLength() public static method

Return the minimum length of the pinch.
public static GetMinPinchLength ( ) : float
return float

GetMinTwistAngle() public static method

Gets the minimum twist angle.
public static GetMinTwistAngle ( ) : float
return float

GetOtherReceiverObject() public static method

Return the other event receiver.
public static GetOtherReceiverObject ( ) : GameObject
return GameObject

GetPickableLayer() public static method

Gets the pickable layer.
public static GetPickableLayer ( ) : LayerMask
return LayerMask

GetStationnaryTolerance() public static method

Return the stationnary tolerance.
public static GetStationnaryTolerance ( ) : float
return float

GetSwipeTolerance() public static method

Return the swipe tolerance.
public static GetSwipeTolerance ( ) : float
return float

GetTouchCount() public static method

Return the current touches count.
public static GetTouchCount ( ) : int
return int

GetlongTapTime() public static method

Return the longs the tap time.
public static GetlongTapTime ( ) : float
return float

InitEasyTouch() public method

public InitEasyTouch ( ) : void
return void

IsRectUnderTouch() public static method

Determines if a touch is under a specified rect guiRect.
public static IsRectUnderTouch ( Rect rect, bool guiRect = false ) : bool
rect Rect /// The Rect true rect. ///
guiRect bool /// Determines if the rect is on GUI coordinate ///
return bool

OnDrawGizmos() public method

public OnDrawGizmos ( ) : void
return void

OnEnable() public method

public OnEnable ( ) : void
return void

OnGUI() public method

public OnGUI ( ) : void
return void

RemoveReservedArea() public static method

Removes a reserved area.
public static RemoveReservedArea ( Rect rec ) : void
rec Rect /// Rec. ///
return void

RemoveReservedGuiArea() public static method

public static RemoveReservedGuiArea ( Rect rec ) : void
rec Rect
return void

ResetTouch() public static method

Resets a specific touch.
public static ResetTouch ( int fingerIndex ) : void
fingerIndex int /// Finger index. ///
return void

ResetTouches() public method

public ResetTouches ( ) : void
return void

SetCamera() public static method

Sets the camera uses by EasyTouch to linePick for auto-selection.
public static SetCamera ( Camera cam, bool guiCam = false ) : void
cam Camera /// The camera ///
guiCam bool
return void

SetEnable2FingersGesture() public static method

Enables or disables the recognize of 2 fingers gesture.
public static SetEnable2FingersGesture ( bool enable ) : void
enable bool /// true = enabled
/// false = disabled ///
return void

SetEnableAutoSelect() public static method

Enables or disables auto select.
public static SetEnableAutoSelect ( bool enable ) : void
enable bool /// true = enabled /// false = disables ///
return void

SetEnablePinch() public static method

Enables or disables the recognize of pinch gesture
public static SetEnablePinch ( bool enable ) : void
enable bool /// true = enabled /// false = disables ///
return void

SetEnableTwist() public static method

Enables or disables the recognize of twist gesture
public static SetEnableTwist ( bool enable ) : void
enable bool /// true = enabled
/// false = disabled ///
return void

SetEnabled() public static method

Enables or disables Easy Touch.
public static SetEnabled ( bool enable ) : void
enable bool /// true = enable
/// false = disable ///
return void

SetIsReservedArea() public static method

Sets if Reserved Area is enable or disable
public static SetIsReservedArea ( bool enable ) : void
enable bool /// Enable. ///
return void

SetMinPinchLength() public static method

Sets the minimum length of the pinch.
public static SetMinPinchLength ( float length ) : void
length float /// Float. ///
return void

SetMinTwistAngle() public static method

Sets the minimum twist angle.
public static SetMinTwistAngle ( float angle ) : void
angle float /// Float ///
return void

SetOtherReceiverObject() public static method

Sets the other receiver for EasyTouch event.
public static SetOtherReceiverObject ( GameObject receiver ) : void
receiver GameObject /// GameObject. ///
return void

SetPickableLayer() public static method

Sets the pickable layer.
public static SetPickableLayer ( LayerMask mask ) : void
mask LayerMask /// Mask. ///
return void

SetStationnaryTolerance() public static method

Sets the stationnary tolerance.
public static SetStationnaryTolerance ( float tolerance ) : void
tolerance float /// float Tolerance. ///
return void

SetSwipeTolerance() public static method

Sets the swipe tolerance.
public static SetSwipeTolerance ( float tolerance ) : void
tolerance float /// Float ///
return void

SetlongTapTime() public static method

Set the long tap time in second
public static SetlongTapTime ( float time ) : void
time float /// Float ///
return void

Start() public method

public Start ( ) : void
return void

Update() public method

public Update ( ) : void
return void

UpdateTouches() public method

public UpdateTouches ( bool realTouch, int touchCount ) : void
realTouch bool
touchCount int
return void

Property Details

StationnaryTolerance public property

public float StationnaryTolerance
return float

autoSelect public property

public bool autoSelect
return bool

enable public property

public bool enable
return bool

enable2FingersGesture public property

public bool enable2FingersGesture
return bool

enablePinch public property

public bool enablePinch
return bool

enableRemote public property

public bool enableRemote
return bool

enableReservedArea public property

public bool enableReservedArea
return bool

enableTwist public property

public bool enableTwist
return bool

enabledNGuiMode public property

public bool enabledNGuiMode
return bool

instance public static property

public static EasyTouch, instance
return EasyTouch,

isExtension public property

public bool isExtension
return bool

longTapTime public property

public float longTapTime
return float

minPinchLength public property

public float minPinchLength
return float

minTwistAngle public property

public float minTwistAngle
return float

nGUICameras public property

public List nGUICameras
return List

nGUILayers public property

public LayerMask nGUILayers
return LayerMask

pickableLayers public property

public LayerMask pickableLayers
return LayerMask

receiverObject public property

public GameObject receiverObject
return GameObject

reservedAreas public property

public List reservedAreas
return List

reservedGuiAreas public property

public List reservedGuiAreas
return List

reservedVirtualAreas public property

public List reservedVirtualAreas
return List

secondFingerTexture public property

public Texture secondFingerTexture
return Texture

showGeneral public property

public bool showGeneral
return bool

showGesture public property

public bool showGesture
return bool

showSecondFinger public property

public bool showSecondFinger
return bool

showSelect public property

public bool showSelect
return bool

showTwoFinger public property

public bool showTwoFinger
return bool

swipeKey public property

public KeyCode, swipeKey
return KeyCode,

swipeTolerance public property

public float swipeTolerance
return float

touchCameras public property

public List touchCameras
return List

twistKey public property

public KeyCode, twistKey
return KeyCode,

useBroadcastMessage public property

public bool useBroadcastMessage
return bool