Exemplo n.º 1
0
 void OnGUI()
 {
     //	RTS selection function, mouse click then start draw selection area
     if (mouseAreaSelec)
     {
         // Create a rect from both mouse positions
         var rect = Utils_RTS_Draw.GetScreenRect(curMousPos, Input.mousePosition);
         Utils_RTS_Draw.DrawScreenRect(rect, new Color(0.8f, 0.8f, 0.95f, 0.25f));
         Utils_RTS_Draw.DrawScreenRectBorder(rect, 2, new Color(0.8f, 0.8f, 0.95f));
     }
 }
Exemplo n.º 2
0
 public static void DrawScreenRectBorder(Rect rect, float thickness, Color color)
 {
     // Top
     Utils_RTS_Draw.DrawScreenRect(new Rect(rect.xMin, rect.yMin, rect.width, thickness), color);
     // Left
     Utils_RTS_Draw.DrawScreenRect(new Rect(rect.xMin, rect.yMin, thickness, rect.height), color);
     // Right
     Utils_RTS_Draw.DrawScreenRect(new Rect(rect.xMax - thickness, rect.yMin, thickness, rect.height), color);
     // Bottom
     Utils_RTS_Draw.DrawScreenRect(new Rect(rect.xMin, rect.yMax - thickness, rect.width, thickness), color);
 }