Esempio n. 1
0
 private void OnGUI()
 {
     if (isDragging)
     {
         Rect rect = Multiselect.GetScreenRect(mousePos, Input.mousePosition);
         Multiselect.DrawScreenRect(rect, new Color(0f, 0f, 0f, 0.25f));
         Multiselect.DrawScreenRectBorder(rect, 3, Color.blue);
     }
 }
Esempio n. 2
0
        private bool IsWithinSelectionBounds(Transform tf)
        {
            //if were not dragging, this shouldnt be called
            if (!isDragging)
            {
                return(false);
            }

            Camera cam            = Camera.main;
            Bounds viewPortBounds = Multiselect.GetViewPortBounds(cam, mousePos, Input.mousePosition);

            return(viewPortBounds.Contains(cam.WorldToViewportPoint(tf.position)));
        }