Vuforia点击屏幕自动对焦,过滤UGUI的按钮

        //点击屏幕自对对焦
#if UNITY_EDITOR
        if(!EventSystem.current.IsPointerOverGameObject()&&Input.GetMouseButtonUp(0))
#elif UNITY_ANDROID || UNITY_IPHONE
        if (!EventSystem.current.IsPointerOverGameObject()&& Input.touchCount > 0 && Input.GetTouch(0).phase == TouchPhase.Began)
#endif
        {
            Vuforia.CameraDevice.Instance.SetFocusMode(Vuforia.CameraDevice.FocusMode.FOCUS_MODE_CONTINUOUSAUTO);
        }
EventSystem.current.IsPointerOverGameObject()为判断是否点击在当前UI上
posted @ 2015-01-19 10:24  唐 森  阅读(1145)  评论(0编辑  收藏  举报