Table of Contents

Class UIRoot

Namespace
UILib
Assembly
UILib.dll

The root of UILib. This initializes audio, notifications, the color picker, the input overlay, and handles window management.

You should use onInit to know when you can start using UILib. onInit invokes listeners once UILib has finished setting everything up internally.

public static class UIRoot
Inheritance
UIRoot
Inherited Members

Properties

onInit

Invokes listeners once UILib has been initialized. This indicates when you can start building UIs.

The best place to add a listener to onInit is usually in the Awake of your mod.

public static UnityEvent onInit { get; }

Property Value

UnityEvent

onPreInit

Invokes listeners just before UILib starts initializing itself.

If you need to do anything really specific, this listener is here for those cases.

public static UnityEvent onPreInit { get; }

Property Value

UnityEvent

onWMInit

Invokes listeners once UILib's window management has been initialized.

This happens later than onInit and indicates when canvases have been assigned sorting orders.

public static UnityEvent onWMInit { get; }

Property Value

UnityEvent

Methods

AddShortcut(Shortcut)

Adds a global shortcut. Global shortcuts can be triggered at any time (provided shortcuts can actually run).

This is the recommended way of handling global shortcuts when working with UILib.

Note: You can only add global shortcuts from onInit onwards.

public static void AddShortcut(Shortcut shortcut)

Parameters

shortcut Shortcut

The shortcut to add