Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
When a layer looks for scene objects which were hit by new touches you have some control over which objects it can find. For this purpose you can add a script inheriting from HitTest on an object in the scene which in its
HitResult IsHit(IPointer pointer, HitData hit) method can decide if this object was really hit or not.
For example, using Untouchable behavior you can make an object ignore touches or discard touches hitting this object.
For this purpose
IsHit method can return one of the following values (defined in
- Hit if this touch does hit the object,
- Miss if this touch shouldn't hit the object,
- Discard if this touch shouldn't hit the object and should be discarded completely.