Camera NGUICamera;bool FingerGesturesGlobalFilter( int fingerIndex, Vector2 position ){ Ray ray = NGUICamera.ScreenPointToRay(new Vector3(position.x , position.y, 0)); return !Physics.Raycast(ray, 200, LayerMask.NameToLayer("NGUI"));}void Start(){ NGUICamera = UICamera.FindCameraForLayer(.camera; // function argument expect layer number; not mask FingerGestures.GlobalTouchFilter = FingerGesturesGlobalFilter; // setup the delegate}
I've been using FingerGestures for non-NGUI objects but it should be pretty straightforward. They don't interfere with each other. You can use the toolbox scripts it comes with (uses SendMessage) and direct your gestures to a script that has access to the NGUI components to modify.If you want FingerGestures to ignore touches that began by touching an NGUI object's collider just setup the global filter delegate. Here's a quick snippet to illustrate how to do this. My UI is on a layer called NGUI, which is layer 8.Camera NGUICamera; bool FingerGesturesGlobalFilter( int fingerIndex, Vector2 position ){ Ray ray = NGUICamera.ScreenPointToRay(new Vector3(position.x , position.y, 0)); return !Physics.Raycast(ray, 200, LayerMask.NameToLayer("NGUI"));} void Start(){ NGUICamera = UICamera.FindCameraForLayer(8).camera; // function argument expect layer number; not mask FingerGestures.GlobalTouchFilter = FingerGesturesGlobalFilter; // setup the delegate}