TouchLayer Class |
Namespace: TouchScript.Layers
public abstract class TouchLayer : MonoBehaviour
The TouchLayer type exposes the following members.
Name | Description | |
---|---|---|
TouchLayer | Initializes a new instance of the TouchLayer class |
Name | Description | |
---|---|---|
Delegate |
Gets or sets an object implementing ILayerDelegate to be asked for layer specific actions.
| |
WorldProjectionNormal |
Layers screen to world projection normal.
|
Name | Description | |
---|---|---|
addPointer |
Called when a pointer is added.
| |
Awake |
Unity Awake callback.
| |
cancelPointer |
Called when a pointer is cancelled.
| |
checkHitFilters |
Checks the hit filters.
| |
createProjectionParams |
Creates projection parameters.
| |
GetProjectionParams |
Gets the projection parameters of this layer which might depend on a specific pointer data.
| |
Hit |
Checks if a point in screen coordinates hits something in this layer.
| |
OnDestroy |
Unity OnDestroy callback.
| |
pressPointer |
Called when a layer is pressed over an object detected by this layer.
| |
releasePointer |
Called when a pointer is released.
| |
removePointer |
Called when a pointer is removed.
| |
setName |
Updates pointer layers's name.
| |
updatePointer |
Called when a pointer is moved.
|
Name | Description | |
---|---|---|
PointerBegan |
Occurs when layer determines that a pointer has hit something.
|
Name | Description | |
---|---|---|
layerProjectionParams |
The layer projection parameters.
| |
manager |
Layer manager.
| |
Name |
Pointer layer's name.
|
In TouchScript it's a layer's job to determine if a pointer on the screen hits anything in Unity's 3d/2d world.
ILayerManager keeps a sorted list of all layers in Layers which it queries when a new pointer appears. It's a layer's job to return Hit if this pointer hits an object. Layers can even be used to "hit" objects outside of Unity's 3d world, for example Scaleform integration is implemented this way.
Layers can be configured in a scene using TouchManager or from code using ITouchManager API.
If you want to route pointers and manually control which objects they should "pointer" it's better to create a new layer extending TouchLayer.