예제 #1
0
        private Renderer[] EndPick(Color32[] texPixels, Vector2Int texSize, Renderer[] renderers, Bounds bounds)
        {
            Canvas        canvas      = Window.GetComponentInParent <Canvas>();
            RectTransform sceneOutput = Window.GetComponent <RectTransform>();

            if (sceneOutput.childCount > 0)
            {
                sceneOutput = (RectTransform)Window.GetComponent <RectTransform>().GetChild(0);
            }

            Rect selectionRect = SelectionBoundsToSelectionRect(bounds, canvas, sceneOutput);

            return(BoxSelectionRenderer.PickRenderersInRect(Window.Camera, selectionRect, renderers, texPixels, texSize));
        }
예제 #2
0
        private IEnumerable <Renderer> PixelPerfectDepthTest(Renderer[] renderers, Bounds bounds)
        {
            Canvas canvas = Window.GetComponentInParent <Canvas>();

            RectTransform sceneOutput = Window.GetComponent <RectTransform>();

            if (sceneOutput.childCount > 0)
            {
                sceneOutput = (RectTransform)Window.GetComponent <RectTransform>().GetChild(0);
            }

            Rect rect = SelectionBoundsToSelectionRect(bounds, canvas, sceneOutput);

            return(BoxSelectionRenderer.PickRenderersInRect(Window.Camera, rect, renderers, Mathf.RoundToInt(canvas.pixelRect.width), Mathf.RoundToInt(canvas.pixelRect.height)));
        }