Skip to content

Util

interludesoftware.tick

Interlude.Tick

Util Class

public static class Util

Inheritance System.Object → Util

Methods

Util.Floor(this Rect) Method

Returns a copy of rect with all components floored to the nearest integer.

public static Rect Floor(this Rect rect);

Parameters

rect UnityEngine.Rect

Returns

UnityEngine.Rect

Util.GetHalfHeight(this Rect) Method

Returns half the height of rect.

public static float GetHalfHeight(this Rect rect);

Parameters

rect UnityEngine.Rect

Returns

System.Single

Util.GetHalfWidth(this Rect) Method

Returns half the width of rect.

public static float GetHalfWidth(this Rect rect);

Parameters

rect UnityEngine.Rect

Returns

System.Single

Util.Grow(this Rect, Vector2) Method

Expands rect by size.

public static Rect Grow(this Rect rect, Vector2 size);

Parameters

rect UnityEngine.Rect

size UnityEngine.Vector2

Returns

UnityEngine.Rect

Util.Offset(this Rect, Vector2) Method

Translates rect by offset.

public static Rect Offset(this Rect rect, Vector2 offset);

Parameters

rect UnityEngine.Rect

offset UnityEngine.Vector2

Returns

UnityEngine.Rect

Util.PushRectInsideRect(this Rect, Rect) Method

Translates rect so it sits inside other. Dimensions are preserved; only position changes. If rect is larger than other on an axis, the output is clamped against the min edge on that axis (it will still extend past the max edge).

public static Rect PushRectInsideRect(this Rect rect, Rect other);

Parameters

rect UnityEngine.Rect

other UnityEngine.Rect

Returns

UnityEngine.Rect