Click or drag to resize

FingersScript Class

The main Unity fingers script - only one of these should exist. FingersScript.Instance gives you easy access to add and remove gestures.
Inheritance Hierarchy
SystemObject
  Object
    Component
      Behaviour
        MonoBehaviour
          DigitalRubySharedFingersScript

Namespace:  DigitalRubyShared
Assembly:  Assembly-CSharp (in Assembly-CSharp.dll) Version: 0.0.0.0
Syntax
C#
public class FingersScript : MonoBehaviour

The FingersScript type exposes the following members.

Constructors
  NameDescription
Public methodFingersScript
Initializes a new instance of the FingersScript class
Top
Properties
  NameDescription
Public propertyanimation Obsolete.

The Animation attached to this GameObject. (Null if there is none attached).

(Inherited from Component.)
Public propertyaudio Obsolete.

The AudioSource attached to this GameObject. (Null if there is none attached).

(Inherited from Component.)
Public propertycamera Obsolete.

The Camera attached to this GameObject. (Null if there is none attached).

(Inherited from Component.)
Public propertyCaptureGestureHandler
Optional handler to determine whether a game object will pass through or not. Null handler gets default gesture capture handling. Non-null handler that returns null gets default handling. Non-null handler that returns true captures the gesture. Non-null handler that returns false passes the gesture through.
Public propertycollider Obsolete.

The Collider attached to this GameObject. (Null if there is none attached).

(Inherited from Component.)
Public propertycollider2D Obsolete.

The Collider2D component attached to the object.

(Inherited from Component.)
Public propertyComponentTypesToDenyPassThrough
A set of component types that will stop the gesture from passing through. By default includes UI components like Button, Dropdown, etc. You can add additional component types if you like, but you should not remove items from this set or clear the set.
Public propertyComponentTypesToIgnorePassThrough
A set of component types that will be ignored for purposes of pass through checking. By default includes the Text UI component. You can add additional component types if you like, but you should not remove items from this set or clear the set.
Public propertyconstantForce Obsolete.

The ConstantForce attached to this GameObject. (Null if there is none attached).

(Inherited from Component.)
Public propertyCurrentTouches
Current touch objects begin tracked
Public propertyenabled

Enabled Behaviours are Updated, disabled Behaviours are not.

(Inherited from Behaviour.)
Public propertygameObject

The game object this component is attached to. A component is always attached to a game object.

(Inherited from Component.)
Public propertyGestures
All gestures added to the script
Public propertyguiElement Obsolete. (Inherited from Component.)
Public propertyguiText Obsolete.

The GUIText attached to this GameObject. (Null if there is none attached).

(Inherited from Component.)
Public propertyguiTexture Obsolete.

The GUITexture attached to this GameObject (Read Only). (null if there is none attached).

(Inherited from Component.)
Public propertyStatic memberHasInstance
Check whether Instance is not null without it actually creating a prefab if needed Call this when removing the gestures in OnDisable
Public propertyhideFlags

Should the object be hidden, saved with the scene or modifiable by the user?

(Inherited from Object.)
Public propertyhingeJoint Obsolete.

The HingeJoint attached to this GameObject. (Null if there is none attached).

(Inherited from Component.)
Public propertyStatic memberInstance
Shared static instance of fingers script that lives forever - the prefab MUST exist in a resources folder! Note that you can still add the prefab to your scene if you prefer to do it that way, in which case the singleton will be re-created each time a scene loads.
Public propertyisActiveAndEnabled

Has the Behaviour had enabled called.

(Inherited from Behaviour.)
Public propertylight Obsolete.

The Light attached to this GameObject. (Null if there is none attached).

(Inherited from Component.)
Public propertyname

The name of the object.

(Inherited from Object.)
Public propertynetworkView Obsolete.

The NetworkView attached to this GameObject (Read Only). (null if there is none attached).

(Inherited from Component.)
Public propertyparticleEmitter Obsolete.

The ParticleEmitter attached to this GameObject. (Null if there is none attached).

(Inherited from Component.)
Public propertyparticleSystem Obsolete.

The ParticleSystem attached to this GameObject. (Null if there is none attached).

(Inherited from Component.)
Public propertyPreviousTouches
Previous touch locations
Public propertyrenderer Obsolete.

The Renderer attached to this GameObject. (Null if there is none attached).

(Inherited from Component.)
Public propertyrigidbody Obsolete.

The Rigidbody attached to this GameObject. (Null if there is none attached).

(Inherited from Component.)
Public propertyrigidbody2D Obsolete.

The Rigidbody2D that is attached to the Component's GameObject.

(Inherited from Component.)
Public propertyrunInEditMode

Allow a specific instance of a MonoBehaviour to run in edit mode (only available in the editor).

(Inherited from MonoBehaviour.)
Public propertytag

The tag of this game object.

(Inherited from Component.)
Public propertyTouches
Gets a collection of the current touches
Public propertytransform

The Transform attached to this GameObject.

(Inherited from Component.)
Public propertyuseGUILayout

Disabling this lets you skip the GUI layout phase.

(Inherited from MonoBehaviour.)
Public propertyVirtualTouchCountHandler
Get a count of virtual touches, null for none. This callback is where you should update and populate the current set of gestures for your virtual touches.
Public propertyVirtualTouchObjectHandler
Get a virtual touch from a given index (0 to count - 1), null for none. Use GestureTouchFromVirtualTouch once a frame to create the GestureTouch object.
Public propertyVirtualTouchResetHandler
This is called anytime fingers script is reset. All virtual touches should be cleared.
Public propertyVirtualTouchUpdateHandler
This event executes after the all virtual touches have been processed by the fingers script. This is where you would remove any ended gestures from your virtual touch gesture lists or dictionaries.
Top
Methods
  NameDescription
Public methodAddGesture
Add a gesture to the fingers script. This gesture will give callbacks when it changes state.
Public methodBroadcastMessage(String)

Calls the method named methodName on every MonoBehaviour in this game object or any of its children.

(Inherited from Component.)
Public methodBroadcastMessage(String, Object)

Calls the method named methodName on every MonoBehaviour in this game object or any of its children.

(Inherited from Component.)
Public methodBroadcastMessage(String, SendMessageOptions)

Calls the method named methodName on every MonoBehaviour in this game object or any of its children.

(Inherited from Component.)
Public methodBroadcastMessage(String, Object, SendMessageOptions)

Calls the method named methodName on every MonoBehaviour in this game object or any of its children.

(Inherited from Component.)
Public methodCancelInvoke

Cancels all Invoke calls on this MonoBehaviour.

(Inherited from MonoBehaviour.)
Public methodCancelInvoke(String)

Cancels all Invoke calls with name methodName on this behaviour.

(Inherited from MonoBehaviour.)
Public methodCompareTag

Is this game object tagged with tag ?

(Inherited from Component.)
Public methodEquals (Inherited from Object.)
Protected methodFinalize (Inherited from Object.)
Public methodStatic memberGestureIntersectsObject
Check if a gesture intersects an object
Public methodGestureTouchFromVirtualTouch
Create a gesture touch object from a virtual touch object and updates the previous position internally
Public methodStatic memberGetCameraForGesture
Get camera for a gesture using gesture start location
Public methodGetComponent(Type)

Returns the component of Type type if the game object has one attached, null if it doesn't.

(Inherited from Component.)
Public methodGetComponent(String)

Returns the component with name type if the game object has one attached, null if it doesn't.

(Inherited from Component.)
Public methodGetComponent``1 (Inherited from Component.)
Public methodGetComponentInChildren(Type)

Returns the component of Type type in the GameObject or any of its children using depth first search.

(Inherited from Component.)
Public methodGetComponentInChildren(Type, Boolean) (Inherited from Component.)
Public methodGetComponentInChildren``1 (Inherited from Component.)
Public methodGetComponentInChildren``1(Boolean) (Inherited from Component.)
Public methodGetComponentInParent(Type)

Returns the component of Type type in the GameObject or any of its parents.

(Inherited from Component.)
Public methodGetComponentInParent``1 (Inherited from Component.)
Public methodGetComponents(Type)

Returns all components of Type type in the GameObject.

(Inherited from Component.)
Public methodGetComponents(Type, ListComponent) (Inherited from Component.)
Public methodGetComponents``1 (Inherited from Component.)
Public methodGetComponents``1(ListUMP) (Inherited from Component.)
Public methodGetComponentsInChildren(Type)

Returns all components of Type type in the GameObject or any of its children.

(Inherited from Component.)
Public methodGetComponentsInChildren(Type, Boolean)

Returns all components of Type type in the GameObject or any of its children.

(Inherited from Component.)
Public methodGetComponentsInChildren``1 (Inherited from Component.)
Public methodGetComponentsInChildren``1(Boolean) (Inherited from Component.)
Public methodGetComponentsInChildren``1(ListUMP) (Inherited from Component.)
Public methodGetComponentsInChildren``1(Boolean, ListUMP) (Inherited from Component.)
Public methodGetComponentsInParent(Type) (Inherited from Component.)
Public methodGetComponentsInParent(Type, Boolean)

Returns all components of Type type in the GameObject or any of its parents.

(Inherited from Component.)
Public methodGetComponentsInParent``1 (Inherited from Component.)
Public methodGetComponentsInParent``1(Boolean) (Inherited from Component.)
Public methodGetComponentsInParent``1(Boolean, ListUMP) (Inherited from Component.)
Public methodGetHashCode (Inherited from Object.)
Public methodGetInstanceID

Returns the instance id of the object.

(Inherited from Object.)
Public methodGetType (Inherited from Object.)
Public methodInvoke

Invokes the method methodName in time seconds.

(Inherited from MonoBehaviour.)
Public methodInvokeRepeating

Invokes the method methodName in time seconds, then repeatedly every repeatRate seconds.

(Inherited from MonoBehaviour.)
Public methodIsInvoking

Is any invoke pending on this MonoBehaviour?

(Inherited from MonoBehaviour.)
Public methodIsInvoking(String)

Is any invoke on methodName pending?

(Inherited from MonoBehaviour.)
Protected methodMemberwiseClone (Inherited from Object.)
Public methodStatic memberRectTransformToScreenSpace
Convert rect transform to screen space
Public methodRemoveGesture
Remove a gesture from the script and dispose of it. The gesture will no longer give callbacks. You will need to re-create the gesture.
Public methodResetState
Reset state - all touches and tracking are cleared
Public methodSendMessage(String)

Calls the method named methodName on every MonoBehaviour in this game object.

(Inherited from Component.)
Public methodSendMessage(String, Object)

Calls the method named methodName on every MonoBehaviour in this game object.

(Inherited from Component.)
Public methodSendMessage(String, SendMessageOptions)

Calls the method named methodName on every MonoBehaviour in this game object.

(Inherited from Component.)
Public methodSendMessage(String, Object, SendMessageOptions)

Calls the method named methodName on every MonoBehaviour in this game object.

(Inherited from Component.)
Public methodSendMessageUpwards(String)

Calls the method named methodName on every MonoBehaviour in this game object and on every ancestor of the behaviour.

(Inherited from Component.)
Public methodSendMessageUpwards(String, Object)

Calls the method named methodName on every MonoBehaviour in this game object and on every ancestor of the behaviour.

(Inherited from Component.)
Public methodSendMessageUpwards(String, SendMessageOptions)

Calls the method named methodName on every MonoBehaviour in this game object and on every ancestor of the behaviour.

(Inherited from Component.)
Public methodSendMessageUpwards(String, Object, SendMessageOptions)

Calls the method named methodName on every MonoBehaviour in this game object and on every ancestor of the behaviour.

(Inherited from Component.)
Public methodStartCoroutine(IEnumerator)

Starts a coroutine.

(Inherited from MonoBehaviour.)
Public methodStartCoroutine(String)

Starts a coroutine named methodName.

(Inherited from MonoBehaviour.)
Public methodStartCoroutine(String, Object)

Starts a coroutine named methodName.

(Inherited from MonoBehaviour.)
Public methodStartCoroutine_Auto Obsolete. (Inherited from MonoBehaviour.)
Public methodStatic memberStartOrResetGesture
Start or reset a gesture
Public methodStopAllCoroutines

Stops all coroutines running on this behaviour.

(Inherited from MonoBehaviour.)
Public methodStopCoroutine(String)

Stops the first coroutine named methodName, or the coroutine stored in routine running on this behaviour.

(Inherited from MonoBehaviour.)
Public methodStopCoroutine(IEnumerator)

Stops the first coroutine named methodName, or the coroutine stored in routine running on this behaviour.

(Inherited from MonoBehaviour.)
Public methodStopCoroutine(Coroutine)

Stops the first coroutine named methodName, or the coroutine stored in routine running on this behaviour.

(Inherited from MonoBehaviour.)
Public methodToString

Returns the name of the GameObject.

(Inherited from Object.)
Top
Fields
  NameDescription
Public fieldAutoAddRequiredComponents
Whether to auto-add required components like physics raycasters, event system, etc. if they are missing.
Public fieldDefaultDPI
The default DPI to use if the DPI cannot be determined
Public fieldEnableMultiTouch
Whether to enable Unity input multi-touch automatically.
Public fieldLevelUnloadOption
Allows resetting state (keeps the gestures, just resets them) or clearing all gestures when a level is unloaded.
Public fieldMouseDistanceInUnitsForScaleAndRotate
The distance (in units, default is inches) for simulated fingers to start at for a mouse zoom or rotate.
Public fieldMouseWheelDeltaMultiplier
Mouse wheel delta multiplier.
Public fieldPassThroughObjects
Objects that should pass gestures through. By default, some UI components block gestures, such as Panel, Button, Dropdown, etc. See the SetupDefaultPassThroughComponents method for the full list of defaults.
Public fieldProcessUnityTouches
Whether to process Unity touch events. If false, you will need to implement the VirtualTouch* methods to implement touch handling.
Public fieldRequireControlKeyForMouseZoom
Whether the control key is required for mouse zoom. If true, control pluse mouse wheel zooms. If false, mouse wheel alone will zoom.
Public fieldShowTouches
Whether to show touches using the TouchCircles array. Make sure to turn this off before releasing your game or app.
Public fieldSimulateMouseWithTouches
Whether to treat touches as mouse pointer? This needs to be set before the script Awake method is called.
Public fieldTouchCircles
If ShowTouches is true, this array is used to show the touches. The FingersScriptPrefab sets this up as 10 circles.
Public fieldTreatMousePointerAsFinger
True to treat the mouse as a finger, false otherwise. Left, middle and right mouse buttons can be used as individual fingers and will all have the same location.
Public fieldTreatMouseWheelAsFingers
True to treat the mouse wheel as two fingers for rotation and scaling, false otherwise.
Top
See Also