UnityEngine.UI.GraphicRaycaster.Raycast C# (CSharp) Method

Raycast() private static method

private static Raycast ( Canvas canvas, Camera eventCamera, Vector2 pointerPosition, List results ) : void
canvas UnityEngine.Canvas
eventCamera UnityEngine.Camera
pointerPosition Vector2
results List
return void
        private static void Raycast(Canvas canvas, Camera eventCamera, Vector2 pointerPosition, List<Graphic> results)
        {
            IList<Graphic> graphicsForCanvas = GraphicRegistry.GetGraphicsForCanvas(canvas);
            for (int i = 0; i < graphicsForCanvas.Count; i++)
            {
                Graphic item = graphicsForCanvas[i];
                if (((item.depth != -1) && item.raycastTarget) && (RectTransformUtility.RectangleContainsScreenPoint(item.rectTransform, pointerPosition, eventCamera) && item.Raycast(pointerPosition, eventCamera)))
                {
                    s_SortedGraphics.Add(item);
                }
            }
            if (<>f__am$cache0 == null)
            {
                <>f__am$cache0 = (g1, g2) => g2.depth.CompareTo(g1.depth);

Same methods

GraphicRaycaster::Raycast ( PointerEventData eventData, List resultAppendList ) : void

Usage Example

Esempio n. 1
0
 static public int Raycast(IntPtr l)
 {
     try {
                     #if DEBUG
         var    method     = System.Reflection.MethodBase.GetCurrentMethod();
         string methodName = GetMethodName(method);
                     #if UNITY_5_5_OR_NEWER
         UnityEngine.Profiling.Profiler.BeginSample(methodName);
                     #else
         Profiler.BeginSample(methodName);
                     #endif
                     #endif
         UnityEngine.UI.GraphicRaycaster           self = (UnityEngine.UI.GraphicRaycaster)checkSelf(l);
         UnityEngine.EventSystems.PointerEventData a1;
         checkType(l, 2, out a1);
         System.Collections.Generic.List <UnityEngine.EventSystems.RaycastResult> a2;
         checkType(l, 3, out a2);
         self.Raycast(a1, a2);
         pushValue(l, true);
         return(1);
     }
     catch (Exception e) {
         return(error(l, e));
     }
             #if DEBUG
     finally {
                     #if UNITY_5_5_OR_NEWER
         UnityEngine.Profiling.Profiler.EndSample();
                     #else
         Profiler.EndSample();
                     #endif
     }
             #endif
 }
All Usage Examples Of UnityEngine.UI.GraphicRaycaster::Raycast