C# Класс 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.
Наследование: MonoBehaviour
Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
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

Открытые методы

Метод Описание
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

Приватные методы

Метод Описание
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

Описание методов

AddReservedArea() публичный статический Метод

Adds a reserved area.
public static AddReservedArea ( Rect rec ) : void
rec Rect /// Rec. ///
Результат void

AddReservedGuiArea() публичный статический Метод

public static AddReservedGuiArea ( Rect rec ) : void
rec Rect
Результат void

EasyTouch() публичный Метод

public EasyTouch ( ) : UnityEngine
Результат UnityEngine

GetCamera() публичный статический Метод

Return the camera used by EasyTouch for the auto-selection.
public static GetCamera ( int index ) : Camera
index int
Результат Camera

GetCurrentPickedObject() публичный статический Метод

Gets the current picked object under a specific touch
public static GetCurrentPickedObject ( int fingerIndex ) : GameObject
fingerIndex int /// Finger index. ///
Результат GameObject

GetEnable2FingersGesture() публичный статический Метод

Return if 2 fingers gesture is enabled or disabled
public static GetEnable2FingersGesture ( ) : bool
Результат bool

GetEnableAutoSelect() публичный статический Метод

Return if auto select is enabled or disabled
public static GetEnableAutoSelect ( ) : bool
Результат bool

GetEnablePinch() публичный статический Метод

Return if 2 pinch gesture is enabled or disabled
public static GetEnablePinch ( ) : bool
Результат bool

GetEnableTwist() публичный статический Метод

Return if 2 twist gesture is enabled or disabled
public static GetEnableTwist ( ) : bool
Результат bool

GetEnabled() публичный статический Метод

Return if EasyTouch is enabled or disabled.
public static GetEnabled ( ) : bool
Результат bool

GetFingerPosition() публичный статический Метод

Gets the a specific finger position.
public static GetFingerPosition ( int fingerIndex ) : Vector2
fingerIndex int /// Finger index. ///
Результат Vector2

GetIsReservedArea() публичный статический Метод

Return if Reserved Area is enable or disable
public static GetIsReservedArea ( ) : bool
Результат bool

GetMinPinchLength() публичный статический Метод

Return the minimum length of the pinch.
public static GetMinPinchLength ( ) : float
Результат float

GetMinTwistAngle() публичный статический Метод

Gets the minimum twist angle.
public static GetMinTwistAngle ( ) : float
Результат float

GetOtherReceiverObject() публичный статический Метод

Return the other event receiver.
public static GetOtherReceiverObject ( ) : GameObject
Результат GameObject

GetPickableLayer() публичный статический Метод

Gets the pickable layer.
public static GetPickableLayer ( ) : LayerMask
Результат LayerMask

GetStationnaryTolerance() публичный статический Метод

Return the stationnary tolerance.
public static GetStationnaryTolerance ( ) : float
Результат float

GetSwipeTolerance() публичный статический Метод

Return the swipe tolerance.
public static GetSwipeTolerance ( ) : float
Результат float

GetTouchCount() публичный статический Метод

Return the current touches count.
public static GetTouchCount ( ) : int
Результат int

GetlongTapTime() публичный статический Метод

Return the longs the tap time.
public static GetlongTapTime ( ) : float
Результат float

InitEasyTouch() публичный Метод

public InitEasyTouch ( ) : void
Результат void

IsRectUnderTouch() публичный статический Метод

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 ///
Результат bool

OnDrawGizmos() публичный Метод

public OnDrawGizmos ( ) : void
Результат void

OnEnable() публичный Метод

public OnEnable ( ) : void
Результат void

OnGUI() публичный Метод

public OnGUI ( ) : void
Результат void

RemoveReservedArea() публичный статический Метод

Removes a reserved area.
public static RemoveReservedArea ( Rect rec ) : void
rec Rect /// Rec. ///
Результат void

RemoveReservedGuiArea() публичный статический Метод

public static RemoveReservedGuiArea ( Rect rec ) : void
rec Rect
Результат void

ResetTouch() публичный статический Метод

Resets a specific touch.
public static ResetTouch ( int fingerIndex ) : void
fingerIndex int /// Finger index. ///
Результат void

ResetTouches() публичный Метод

public ResetTouches ( ) : void
Результат void

SetCamera() публичный статический Метод

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
Результат void

SetEnable2FingersGesture() публичный статический Метод

Enables or disables the recognize of 2 fingers gesture.
public static SetEnable2FingersGesture ( bool enable ) : void
enable bool /// true = enabled
/// false = disabled ///
Результат void

SetEnableAutoSelect() публичный статический Метод

Enables or disables auto select.
public static SetEnableAutoSelect ( bool enable ) : void
enable bool /// true = enabled /// false = disables ///
Результат void

SetEnablePinch() публичный статический Метод

Enables or disables the recognize of pinch gesture
public static SetEnablePinch ( bool enable ) : void
enable bool /// true = enabled /// false = disables ///
Результат void

SetEnableTwist() публичный статический Метод

Enables or disables the recognize of twist gesture
public static SetEnableTwist ( bool enable ) : void
enable bool /// true = enabled
/// false = disabled ///
Результат void

SetEnabled() публичный статический Метод

Enables or disables Easy Touch.
public static SetEnabled ( bool enable ) : void
enable bool /// true = enable
/// false = disable ///
Результат void

SetIsReservedArea() публичный статический Метод

Sets if Reserved Area is enable or disable
public static SetIsReservedArea ( bool enable ) : void
enable bool /// Enable. ///
Результат void

SetMinPinchLength() публичный статический Метод

Sets the minimum length of the pinch.
public static SetMinPinchLength ( float length ) : void
length float /// Float. ///
Результат void

SetMinTwistAngle() публичный статический Метод

Sets the minimum twist angle.
public static SetMinTwistAngle ( float angle ) : void
angle float /// Float ///
Результат void

SetOtherReceiverObject() публичный статический Метод

Sets the other receiver for EasyTouch event.
public static SetOtherReceiverObject ( GameObject receiver ) : void
receiver GameObject /// GameObject. ///
Результат void

SetPickableLayer() публичный статический Метод

Sets the pickable layer.
public static SetPickableLayer ( LayerMask mask ) : void
mask LayerMask /// Mask. ///
Результат void

SetStationnaryTolerance() публичный статический Метод

Sets the stationnary tolerance.
public static SetStationnaryTolerance ( float tolerance ) : void
tolerance float /// float Tolerance. ///
Результат void

SetSwipeTolerance() публичный статический Метод

Sets the swipe tolerance.
public static SetSwipeTolerance ( float tolerance ) : void
tolerance float /// Float ///
Результат void

SetlongTapTime() публичный статический Метод

Set the long tap time in second
public static SetlongTapTime ( float time ) : void
time float /// Float ///
Результат void

Start() публичный Метод

public Start ( ) : void
Результат void

Update() публичный Метод

public Update ( ) : void
Результат void

UpdateTouches() публичный Метод

public UpdateTouches ( bool realTouch, int touchCount ) : void
realTouch bool
touchCount int
Результат void

Описание свойств

StationnaryTolerance публичное свойство

public float StationnaryTolerance
Результат float

autoSelect публичное свойство

public bool autoSelect
Результат bool

enable публичное свойство

public bool enable
Результат bool

enable2FingersGesture публичное свойство

public bool enable2FingersGesture
Результат bool

enablePinch публичное свойство

public bool enablePinch
Результат bool

enableRemote публичное свойство

public bool enableRemote
Результат bool

enableReservedArea публичное свойство

public bool enableReservedArea
Результат bool

enableTwist публичное свойство

public bool enableTwist
Результат bool

enabledNGuiMode публичное свойство

public bool enabledNGuiMode
Результат bool

instance публичное статическое свойство

public static EasyTouch, instance
Результат EasyTouch,

isExtension публичное свойство

public bool isExtension
Результат bool

longTapTime публичное свойство

public float longTapTime
Результат float

minPinchLength публичное свойство

public float minPinchLength
Результат float

minTwistAngle публичное свойство

public float minTwistAngle
Результат float

nGUICameras публичное свойство

public List nGUICameras
Результат List

nGUILayers публичное свойство

public LayerMask nGUILayers
Результат LayerMask

pickableLayers публичное свойство

public LayerMask pickableLayers
Результат LayerMask

receiverObject публичное свойство

public GameObject receiverObject
Результат GameObject

reservedAreas публичное свойство

public List reservedAreas
Результат List

reservedGuiAreas публичное свойство

public List reservedGuiAreas
Результат List

reservedVirtualAreas публичное свойство

public List reservedVirtualAreas
Результат List

secondFingerTexture публичное свойство

public Texture secondFingerTexture
Результат Texture

showGeneral публичное свойство

public bool showGeneral
Результат bool

showGesture публичное свойство

public bool showGesture
Результат bool

showSecondFinger публичное свойство

public bool showSecondFinger
Результат bool

showSelect публичное свойство

public bool showSelect
Результат bool

showTwoFinger публичное свойство

public bool showTwoFinger
Результат bool

swipeKey публичное свойство

public KeyCode, swipeKey
Результат KeyCode,

swipeTolerance публичное свойство

public float swipeTolerance
Результат float

touchCameras публичное свойство

public List touchCameras
Результат List

twistKey публичное свойство

public KeyCode, twistKey
Результат KeyCode,

useBroadcastMessage публичное свойство

public bool useBroadcastMessage
Результат bool