forked from TouchScript/TouchScript
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathITouch.cs
More file actions
65 lines (56 loc) · 2 KB
/
ITouch.cs
File metadata and controls
65 lines (56 loc) · 2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
/*
* @author Valentin Simonov / http://va.lent.in/
*/
using System.Collections.Generic;
using TouchScript.Hit;
using TouchScript.Layers;
using UnityEngine;
namespace TouchScript
{
/// <summary>
/// <para>Representation of a finger within TouchScript.</para>
/// <para>An object implementing this interface is created when user touches the screen. A unique id is assigned to it which doesn't change throughout its life.</para>
/// <para><b>Attention!</b> Do not store references to these objects beyond touch's lifetime (i.e. when target finger is lifted off). These objects may be reused internally. Store unique ids instead.</para>
/// </summary>
public interface ITouch
{
/// <summary>
/// Internal unique touch point id.
/// </summary>
int Id { get; }
/// <summary>
/// Original hit target.
/// </summary>
Transform Target { get; }
/// <summary>
/// Current position in screen coordinates.
/// </summary>
Vector2 Position { get; }
/// <summary>
/// Previous position (during last frame) in screen coordinates.
/// </summary>
Vector2 PreviousPosition { get; }
/// <summary>
/// Original hit information.
/// <seealso cref="ITouchHit"/>
/// <seealso cref="ITouchHit2D"/>
/// <seealso cref="ITouchHit3D"/>
/// </summary>
ITouchHit Hit { get; }
/// <summary>
/// Original layer which created this touch object.
/// <seealso cref="TouchLayer"/>
/// <seealso cref="CameraLayer"/>
/// <seealso cref="CameraLayer2D"/>
/// </summary>
TouchLayer Layer { get; }
/// <summary>
/// Tags collection for this touch object.
/// </summary>
Tags Tags { get; }
/// <summary>
/// List of custom properties (key-value pairs) for this touch object.
/// </summary>
IDictionary<string, System.Object> Properties { get; }
}
}