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
Afficher le fichier Open project: kofight/CapsUnity Class Usage Examples

Méthodes publiques

Свойство 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

Méthodes publiques

Méthode 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

Méthode 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 méthode

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

AddReservedGuiArea() public static méthode

public static AddReservedGuiArea ( Rect rec ) : void
rec Rect
Résultat void

EasyTouch() public méthode

public EasyTouch ( ) : UnityEngine
Résultat UnityEngine

GetCamera() public static méthode

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

GetCurrentPickedObject() public static méthode

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

GetEnable2FingersGesture() public static méthode

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

GetEnableAutoSelect() public static méthode

Return if auto select is enabled or disabled
public static GetEnableAutoSelect ( ) : bool
Résultat bool

GetEnablePinch() public static méthode

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

GetEnableTwist() public static méthode

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

GetEnabled() public static méthode

Return if EasyTouch is enabled or disabled.
public static GetEnabled ( ) : bool
Résultat bool

GetFingerPosition() public static méthode

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

GetIsReservedArea() public static méthode

Return if Reserved Area is enable or disable
public static GetIsReservedArea ( ) : bool
Résultat bool

GetMinPinchLength() public static méthode

Return the minimum length of the pinch.
public static GetMinPinchLength ( ) : float
Résultat float

GetMinTwistAngle() public static méthode

Gets the minimum twist angle.
public static GetMinTwistAngle ( ) : float
Résultat float

GetOtherReceiverObject() public static méthode

Return the other event receiver.
public static GetOtherReceiverObject ( ) : GameObject
Résultat GameObject

GetPickableLayer() public static méthode

Gets the pickable layer.
public static GetPickableLayer ( ) : LayerMask
Résultat LayerMask

GetStationnaryTolerance() public static méthode

Return the stationnary tolerance.
public static GetStationnaryTolerance ( ) : float
Résultat float

GetSwipeTolerance() public static méthode

Return the swipe tolerance.
public static GetSwipeTolerance ( ) : float
Résultat float

GetTouchCount() public static méthode

Return the current touches count.
public static GetTouchCount ( ) : int
Résultat int

GetlongTapTime() public static méthode

Return the longs the tap time.
public static GetlongTapTime ( ) : float
Résultat float

InitEasyTouch() public méthode

public InitEasyTouch ( ) : void
Résultat void

IsRectUnderTouch() public static méthode

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 ///
Résultat bool

OnDrawGizmos() public méthode

public OnDrawGizmos ( ) : void
Résultat void

OnEnable() public méthode

public OnEnable ( ) : void
Résultat void

OnGUI() public méthode

public OnGUI ( ) : void
Résultat void

RemoveReservedArea() public static méthode

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

RemoveReservedGuiArea() public static méthode

public static RemoveReservedGuiArea ( Rect rec ) : void
rec Rect
Résultat void

ResetTouch() public static méthode

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

ResetTouches() public méthode

public ResetTouches ( ) : void
Résultat void

SetCamera() public static méthode

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
Résultat void

SetEnable2FingersGesture() public static méthode

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

SetEnableAutoSelect() public static méthode

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

SetEnablePinch() public static méthode

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

SetEnableTwist() public static méthode

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

SetEnabled() public static méthode

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

SetIsReservedArea() public static méthode

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

SetMinPinchLength() public static méthode

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

SetMinTwistAngle() public static méthode

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

SetOtherReceiverObject() public static méthode

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

SetPickableLayer() public static méthode

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

SetStationnaryTolerance() public static méthode

Sets the stationnary tolerance.
public static SetStationnaryTolerance ( float tolerance ) : void
tolerance float /// float Tolerance. ///
Résultat void

SetSwipeTolerance() public static méthode

Sets the swipe tolerance.
public static SetSwipeTolerance ( float tolerance ) : void
tolerance float /// Float ///
Résultat void

SetlongTapTime() public static méthode

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

Start() public méthode

public Start ( ) : void
Résultat void

Update() public méthode

public Update ( ) : void
Résultat void

UpdateTouches() public méthode

public UpdateTouches ( bool realTouch, int touchCount ) : void
realTouch bool
touchCount int
Résultat void

Property Details

StationnaryTolerance public_oe property

public float StationnaryTolerance
Résultat float

autoSelect public_oe property

public bool autoSelect
Résultat bool

enable public_oe property

public bool enable
Résultat bool

enable2FingersGesture public_oe property

public bool enable2FingersGesture
Résultat bool

enablePinch public_oe property

public bool enablePinch
Résultat bool

enableRemote public_oe property

public bool enableRemote
Résultat bool

enableReservedArea public_oe property

public bool enableReservedArea
Résultat bool

enableTwist public_oe property

public bool enableTwist
Résultat bool

enabledNGuiMode public_oe property

public bool enabledNGuiMode
Résultat bool

instance public_oe static_oe property

public static EasyTouch, instance
Résultat EasyTouch,

isExtension public_oe property

public bool isExtension
Résultat bool

longTapTime public_oe property

public float longTapTime
Résultat float

minPinchLength public_oe property

public float minPinchLength
Résultat float

minTwistAngle public_oe property

public float minTwistAngle
Résultat float

nGUICameras public_oe property

public List nGUICameras
Résultat List

nGUILayers public_oe property

public LayerMask nGUILayers
Résultat LayerMask

pickableLayers public_oe property

public LayerMask pickableLayers
Résultat LayerMask

receiverObject public_oe property

public GameObject receiverObject
Résultat GameObject

reservedAreas public_oe property

public List reservedAreas
Résultat List

reservedGuiAreas public_oe property

public List reservedGuiAreas
Résultat List

reservedVirtualAreas public_oe property

public List reservedVirtualAreas
Résultat List

secondFingerTexture public_oe property

public Texture secondFingerTexture
Résultat Texture

showGeneral public_oe property

public bool showGeneral
Résultat bool

showGesture public_oe property

public bool showGesture
Résultat bool

showSecondFinger public_oe property

public bool showSecondFinger
Résultat bool

showSelect public_oe property

public bool showSelect
Résultat bool

showTwoFinger public_oe property

public bool showTwoFinger
Résultat bool

swipeKey public_oe property

public KeyCode, swipeKey
Résultat KeyCode,

swipeTolerance public_oe property

public float swipeTolerance
Résultat float

touchCameras public_oe property

public List touchCameras
Résultat List

twistKey public_oe property

public KeyCode, twistKey
Résultat KeyCode,

useBroadcastMessage public_oe property

public bool useBroadcastMessage
Résultat bool