-
Notifications
You must be signed in to change notification settings - Fork 317
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve GUI of NuGet for Unity window (#617)
* refresh the look of the editor window and bring it in line with the modern Unity editor * Updated images in docs * Cached GUI styles * Improve code quality of NugetWindow.cs --------- Co-authored-by: JoC0de <[email protected]>
- Loading branch information
1 parent
7388d28
commit a8ef661
Showing
9 changed files
with
715 additions
and
444 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,99 @@ | ||
using UnityEngine; | ||
|
||
namespace NugetForUnity | ||
{ | ||
/// <summary> | ||
/// Extension methods for manipulating Rect objects. | ||
/// </summary> | ||
internal static class RectHelper | ||
{ | ||
/// <summary> | ||
/// Expands the boundaries of the Rect by a specified value in all directions. | ||
/// </summary> | ||
/// <param name="rect">The rect to update.</param> | ||
/// <param name="value">The value to add.</param> | ||
/// <returns>The updated Rect.</returns> | ||
public static Rect Expand(this Rect rect, float value) | ||
{ | ||
rect.xMin -= value; | ||
rect.xMax += value; | ||
rect.yMin -= value; | ||
rect.yMax += value; | ||
return rect; | ||
} | ||
|
||
/// <summary> | ||
/// Expands the Rect horizontally by a specified value. | ||
/// </summary> | ||
/// <param name="rect">The rect to update.</param> | ||
/// <param name="value">The value to add.</param> | ||
/// <returns>The updated Rect.</returns> | ||
public static Rect ExpandX(this Rect rect, float value) | ||
{ | ||
rect.xMin -= value; | ||
rect.xMax += value; | ||
return rect; | ||
} | ||
|
||
/// <summary> | ||
/// Expands the Rect vertically by a specified value. | ||
/// </summary> | ||
/// <param name="rect">The rect to update.</param> | ||
/// <param name="value">The value to add.</param> | ||
/// <returns>The updated Rect.</returns> | ||
public static Rect ExpandY(this Rect rect, float value) | ||
{ | ||
rect.yMin -= value; | ||
rect.yMax += value; | ||
return rect; | ||
} | ||
|
||
/// <summary> | ||
/// Adds a specified value to the X-coordinate of the Rect. | ||
/// </summary> | ||
/// <param name="rect">The rect to update.</param> | ||
/// <param name="value">The value to add.</param> | ||
/// <returns>The updated Rect.</returns> | ||
public static Rect AddX(this Rect rect, float value) | ||
{ | ||
rect.x += value; | ||
return rect; | ||
} | ||
|
||
/// <summary> | ||
/// Adds a specified value to the Y-coordinate of the Rect. | ||
/// </summary> | ||
/// <param name="rect">The rect to update.</param> | ||
/// <param name="value">The value to add.</param> | ||
/// <returns>The updated Rect.</returns> | ||
public static Rect AddY(this Rect rect, float value) | ||
{ | ||
rect.y += value; | ||
return rect; | ||
} | ||
|
||
/// <summary> | ||
/// Sets the width of the Rect to a specified value. | ||
/// </summary> | ||
/// <param name="rect">The rect to update.</param> | ||
/// <param name="value">The value to set.</param> | ||
/// <returns>The updated Rect.</returns> | ||
public static Rect SetWidth(this Rect rect, float value) | ||
{ | ||
rect.width = value; | ||
return rect; | ||
} | ||
|
||
/// <summary> | ||
/// Sets the height of the Rect to a specified value. | ||
/// </summary> | ||
/// <param name="rect">The rect to update.</param> | ||
/// <param name="value">The value to set.</param> | ||
/// <returns>The updated Rect.</returns> | ||
public static Rect SetHeight(this Rect rect, float value) | ||
{ | ||
rect.height = value; | ||
return rect; | ||
} | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.