Ejemplo n.º 1
0
 //On GUI, used to draw group selects
 private void OnGUI()
 {
     //check if group selecting
     if (groupSelect)
     {
         //draw selection rectangle
         Rect r = GroupSelectUtil.GetGroupRect(initGroupPos, controls.InputPosition());
         GroupSelectUtil.DrawGroupRect(r, groupSelectColor);
         GroupSelectUtil.DrawGroupRectBorder(r, groupSelectBorderColor, 2);
     }
 }
Ejemplo n.º 2
0
    //Draw border rect
    public static void DrawGroupRectBorder(Rect rect, Color color, float size)
    {
        //Top
        GroupSelectUtil.DrawGroupRect(new Rect(rect.xMin, rect.yMin, rect.width, size), color);

        //Left
        GroupSelectUtil.DrawGroupRect(new Rect(rect.xMin, rect.yMin, size, rect.height), color);

        //Right
        GroupSelectUtil.DrawGroupRect(new Rect(rect.xMax - size, rect.yMin, size, rect.height), color);

        //Bottom
        GroupSelectUtil.DrawGroupRect(new Rect(rect.xMin, rect.yMax - size, rect.width, size), color);
    }
Ejemplo n.º 3
0
 public bool UnitInBounds(Transform t)
 {
     return(GroupSelectUtil.GetRectBounds(initGroupPos, controls.InputPosition()).Contains(Camera.main.WorldToViewportPoint(t.position)));
 }