forked from TouchScript/TouchScript
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathUntouchable.cs
More file actions
37 lines (30 loc) · 1.06 KB
/
Copy pathUntouchable.cs
File metadata and controls
37 lines (30 loc) · 1.06 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
/*
* @author Valentin Simonov / http://va.lent.in/
*/
using UnityEngine;
namespace TouchScript.Hit
{
/// <summary>
/// Makes an object it is attached to untouchable, i.e. it completely ignores all touch points landing on it.
/// </summary>
[AddComponentMenu("TouchScript/Behaviors/Untouchable")]
public class Untouchable : HitTest
{
#region Public properties
/// <summary>
/// Indicates if instead of not reacting to touches the object should completely discard them making it impossible for other gestures to receive them.
/// </summary>
/// <value>
/// If <c>true</c> touch points are not only prevented but discarded making it impossible for other gestures to receive them.
/// </value>
public bool DiscardTouch = false;
#endregion
#region Public methods
/// <inheritdoc />
public override ObjectHitResult IsHit(ITouchHit hit)
{
return DiscardTouch ? ObjectHitResult.Discard : ObjectHitResult.Miss;
}
#endregion
}
}