Class UiKit

Namespace
SurvivorsMaker.Presentation
Assembly
SurvivorsMaker.Presentation.dll

Shared hierarchy construction used by the reproducible prefab builder.

public static class UiKit
Inheritance
UiKit
Inherited Members

Methods

AddBorder(Component, UiTheme)

A fine rounded border over surface, outside its layout.

public static Image AddBorder(Component surface, UiTheme theme)

Parameters

surface Component
theme UiTheme

Returns

Image

ApplyButtonSprites(Button, UiTheme)

public static void ApplyButtonSprites(Button button, UiTheme theme)

Parameters

button Button
theme UiTheme

ApplyPanelSprite(Image, UiTheme)

public static void ApplyPanelSprite(Image image, UiTheme theme)

Parameters

image Image
theme UiTheme

ApplySelectableColors(Selectable, UiTheme)

Tint states for sliders, dropdowns and toggles from the theme (buttons use UiButtonVisual).

public static void ApplySelectableColors(Selectable selectable, UiTheme theme)

Parameters

selectable Selectable
theme UiTheme

ApplySelectableColors(Selectable, UiTheme, Color, Color, Color)

public static void ApplySelectableColors(Selectable selectable, UiTheme theme, Color normal, Color hover, Color pressed)

Parameters

selectable Selectable
theme UiTheme
normal Color
hover Color
pressed Color

Bar(Transform, string, Color, UiTheme)

public static Image Bar(Transform parent, string name, Color color, UiTheme theme)

Parameters

parent Transform
name string
color Color
theme UiTheme

Returns

Image

Button(Transform, string, string, UiTheme, UiButtonKind)

A rounded button with state colours, a fine border (secondary/danger) and a focus ring.

public static Button Button(Transform parent, string name, string value, UiTheme theme, UiButtonKind kind = UiButtonKind.Primary)

Parameters

parent Transform
name string
value string
theme UiTheme
kind UiButtonKind

Returns

Button

ButtonText(Button, string)

public static void ButtonText(Button button, string text)

Parameters

button Button
text string

Card(Transform, string, UiTheme, UiColorRole, bool)

A rounded panel or card fill with a fine border; role picks the surface level.

public static Image Card(Transform parent, string name, UiTheme theme, UiColorRole role = UiColorRole.Surface, bool raycast = false)

Parameters

parent Transform
name string
theme UiTheme
role UiColorRole
raycast bool

Returns

Image

CardColumn(Transform, string, UiTheme, float)

A card with a padded vertical layout, for grouped content (selectors, stats).

public static RectTransform CardColumn(Transform parent, string name, UiTheme theme, float spacing = -1)

Parameters

parent Transform
name string
theme UiTheme
spacing float

Returns

RectTransform

Column(Transform, string, UiTheme)

public static RectTransform Column(Transform parent, string name, UiTheme theme)

Parameters

parent Transform
name string
theme UiTheme

Returns

RectTransform

Dropdown(Transform, string, UiTheme)

A TextMesh Pro dropdown drawn like a secondary button, its list like a panel.

public static TMP_Dropdown Dropdown(Transform parent, string name, UiTheme theme)

Parameters

parent Transform
name string
theme UiTheme

Returns

TMP_Dropdown

Fixed(RectTransform, float, float)

public static void Fixed(RectTransform rect, float width, float height)

Parameters

rect RectTransform
width float
height float

Font(TextMeshProUGUI, UiFontRole, UiTheme)

Changes a generated label's size role (e.g. a small caption built with the body size).

public static TextMeshProUGUI Font(TextMeshProUGUI label, UiFontRole role, UiTheme theme)

Parameters

label TextMeshProUGUI
role UiFontRole
theme UiTheme

Returns

TextMeshProUGUI

GridScroll(Transform, string, UiTheme)

public static RectTransform GridScroll(Transform parent, string name, UiTheme theme)

Parameters

parent Transform
name string
theme UiTheme

Returns

RectTransform

Group(Component, bool)

public static CanvasGroup Group(Component target, bool blocksRaycasts = false)

Parameters

target Component
blocksRaycasts bool

Returns

CanvasGroup

IgnoreLayout(RectTransform)

Takes the element out of its parent's layout (overlays such as borders and badges).

public static void IgnoreLayout(RectTransform rect)

Parameters

rect RectTransform

Image(Transform, string, Color, bool)

public static Image Image(Transform parent, string name, Color color, bool raycast = false)

Parameters

parent Transform
name string
color Color
raycast bool

Returns

Image

Label(Transform, string, string, UiTheme, int)

public static TextMeshProUGUI Label(Transform parent, string name, string value, UiTheme theme, int size = 0)

Parameters

parent Transform
name string
value string
theme UiTheme
size int

Returns

TextMeshProUGUI

Layout(RectTransform, float, float, float)

public static LayoutElement Layout(RectTransform rect, float height = -1, float width = -1, float flex = -1)

Parameters

rect RectTransform
height float
width float
flex float

Returns

LayoutElement

Place(RectTransform, Vector2, Vector2, Vector2, Vector2)

Absolute placement for overlay pieces that live outside layout groups.

public static RectTransform Place(RectTransform rect, Vector2 anchor, Vector2 pivot, Vector2 position, Vector2 size)

Parameters

rect RectTransform
anchor Vector2
pivot Vector2
position Vector2
size Vector2

Returns

RectTransform

Rect(Transform, string)

public static RectTransform Rect(Transform parent, string name)

Parameters

parent Transform
name string

Returns

RectTransform

Role(TextMeshProUGUI, UiColorRole, UiTheme)

Changes a generated label's colour role, keeping theme edits working.

public static TextMeshProUGUI Role(TextMeshProUGUI label, UiColorRole role, UiTheme theme)

Parameters

label TextMeshProUGUI
role UiColorRole
theme UiTheme

Returns

TextMeshProUGUI

RoleImage(Transform, string, UiTheme, UiColorRole, bool)

An image whose colour follows a theme role (and optionally the panel sprite) after regeneration.

public static Image RoleImage(Transform parent, string name, UiTheme theme, UiColorRole role, bool panelSprite = false)

Parameters

parent Transform
name string
theme UiTheme
role UiColorRole
panelSprite bool

Returns

Image

Row(Transform, string, UiTheme, float)

public static RectTransform Row(Transform parent, string name, UiTheme theme, float height = -1)

Parameters

parent Transform
name string
theme UiTheme
height float

Returns

RectTransform

Scroll(Transform, string, UiTheme)

public static RectTransform Scroll(Transform parent, string name, UiTheme theme)

Parameters

parent Transform
name string
theme UiTheme

Returns

RectTransform

SetFill(Image, float)

public static void SetFill(Image image, float value)

Parameters

image Image
value float

SetSliced(Image, Sprite)

public static void SetSliced(Image image, Sprite sprite)

Parameters

image Image
sprite Sprite

Size(RectTransform, float, float)

public static void Size(RectTransform rect, float width, float height)

Parameters

rect RectTransform
width float
height float

Slider(Transform, string, UiTheme)

A horizontal 0..1 slider: rounded track, accent fill and a handle that shows the focus colour.

public static Slider Slider(Transform parent, string name, UiTheme theme)

Parameters

parent Transform
name string
theme UiTheme

Returns

Slider

Spacer(Transform, bool)

A flexible gap in a row or column.

public static RectTransform Spacer(Transform parent, bool vertical = false)

Parameters

parent Transform
vertical bool

Returns

RectTransform

Stretch(RectTransform, float)

public static void Stretch(RectTransform rect, float inset = 0)

Parameters

rect RectTransform
inset float

Surface(Transform, string, UiTheme, Vector2)

A modal or side panel: rounded panel fill, fine border, padded vertical layout.

public static RectTransform Surface(Transform parent, string name, UiTheme theme, Vector2 size)

Parameters

parent Transform
name string
theme UiTheme
size Vector2

Returns

RectTransform

Text(Transform, string, string, UiTheme, int)

public static TextMeshProUGUI Text(Transform parent, string name, string key, UiTheme theme, int size = 0)

Parameters

parent Transform
name string
key string
theme UiTheme
size int

Returns

TextMeshProUGUI

TextButton(Transform, string, string, UiTheme, UiButtonKind)

public static Button TextButton(Transform parent, string name, string key, UiTheme theme, UiButtonKind kind = UiButtonKind.Primary)

Parameters

parent Transform
name string
key string
theme UiTheme
kind UiButtonKind

Returns

Button

TextHeight(TextMeshProUGUI, float, bool)

public static void TextHeight(TextMeshProUGUI label, float height, bool flexible = false)

Parameters

label TextMeshProUGUI
height float
flexible bool

Wide(Button, float)

Gives a button a minimum width, for stacked dialog actions of equal size.

public static Button Wide(Button button, float width)

Parameters

button Button
width float

Returns

Button