public bool IsWithinSelectionBounds(GameObject gameObject)
    {
        if (!UnitSelecting.isSelecting)
        {
            return(false);
        }
        var camera         = Camera.main;
        var viewportBounds = UnitSelectingLib.GetViewportBounds(camera, MouseStartingPosition, Input.mousePosition);

        return(viewportBounds.Contains(camera.WorldToViewportPoint(gameObject.transform.position)));
    }
 void OnGUI()
 {
     if (isSelecting)
     {
         Rect rect = UnitSelectingLib.GetScreenRect(MouseStartingPosition, Input.mousePosition);
         //Draw the "inside" box
         UnitSelectingLib.DrawBox(rect, new Color(0.8f, 0.8f, 0.95f, 0.25f));
         // Draw the "border" box
         UnitSelectingLib.DrawBoxBorder(rect, 2, new Color(0.8f, 0.8f, 0.95f));
     }
 }
 public static void DrawBoxBorder(Rect rect, float thickness, Color color)
 {
     // Ve tung canh cua hinh chu nhat
     // thickness: Do dai cua canh hinh chu nhat
     // Top
     UnitSelectingLib.DrawBox(new Rect(rect.xMin, rect.yMin, rect.width, thickness), color);
     // Left
     UnitSelectingLib.DrawBox(new Rect(rect.xMin, rect.yMin, thickness, rect.height), color);
     // Right
     UnitSelectingLib.DrawBox(new Rect(rect.xMax - thickness, rect.yMin, thickness, rect.height), color);
     // Bottom
     UnitSelectingLib.DrawBox(new Rect(rect.xMin, rect.yMax - thickness, rect.width, thickness), color);
 }