Luna UI Manager

Luna UI Manager

Settings

Input Settings

Player Input

A Player Input reference is required for the proper functioning of Escape Action InputPromt component. Represents a single player's input device. Sufficient for singleplayer games.

Player Input Manager

When set, overrides the standalone PlayerInput above. Solution for local multiplayer. Enables multiple players to join and leave the game dynamically. See documentation for more info.

Escape Action Names

Names of InputActions that will trigger escape when performed. See UIViewActionEscape for more info.

Input Icon Database

Input icons for InputPromt components.

Loading Action Maps

Enables all other action maps on start. Optionally, loading transitions with input disables other action maps during the loading screen.

UI Element Manager Settings

Blacklist

List of VisualElement names to ignore. UIElementManager automatically adds hover and click sounds to focusable elements. Add elements here if you cannot disable their focusable state but do not want sounds applied to them.

Integration with Other Components

InputDeviceManager Integration

LunaUIManager automatically initializes and manages the InputDeviceManager. It calls InputDeviceManager.OnEnable() with the configured escape action names and loading action maps, and handles player input registration through the OnPlayerJoined and OnPlayerLeft events.

InputPrompt Integration

The LunaUIManager provides the IconDatabase property that InputPrompt components use to display appropriate input icons for different control schemes. InputPrompt components automatically query this database to get the correct sprites and text for the current input method.

Input Methods

Player Input Events

Methods for handling player join and leave events in multiplayer scenarios. Automatically handled by PlayerInputManager so you don't need to call these manually.

csharp
public void OnPlayerJoined(PlayerInput playerInput) public void OnPlayerLeft(PlayerInput playerInput)

UI Element Manager

UI Element Manager is a feature within the Luna UI Manager.

Manages the registration and state of VisualElement instances within a hierarchy of VisualElement containers. It provides functionality for enabling and disabling groups of elements, which is particularly useful for managing UI navigation.

Automatically adds audio feedback to interactable elements like buttons.

Additionally, it includes functionality for setting a blocker element.

Public Methods

SetBlocker

Disables all UI elements and sets a specified VisualElement as the active blocker, ensuring it remains enabled and interactive. When clicked, it will re-enable all previously disabled elements.

csharp
public void SetBlocker(VisualElement blocker) // or public void SetBlocker(string elementName)

RemoveBlocker

If you want, you can remove blocker manually.

csharp
public void RemoveBlocker()

SetEnabledAllPages

Info: The "disableOtherViewsOnFadeIn" option on UIView uses these functions.

csharp
/// <param name="exceptPages">Pages to ignore.</param> /// <returns> /// List of disabled elements. /// </returns> public List<VisualElement> SetEnabledAllPages(bool enabled, params VisualElement[] exceptPages) // or public List<VisualElement> SetEnabledAllPages(bool enabled, HashSet<VisualElement> exceptPages)

SetEnabledPage

csharp
public void SetEnabledPage(VisualElement page, bool enabled, HashSet<VisualElement> exceptElements)

SetEnabledElements

Enables or disables a specific set of VisualElements. Useful for controlling individual elements or custom groups.

csharp
public void SetEnabledElements(bool enabled, HashSet<VisualElement> elements)

RegisterPage

Info: You don't need to manually register elements when using UIViews.

However, for documentation purposes, the functions are detailed here.

csharp
public void RegisterPage(VisualElement parent)

UnregisterPage

Returns the predefined duration of fade transitions. Note that it does not reflect the current active transition duration.

csharp
public void UnregisterPage(VisualElement parent)

GetPage

csharp
public HashSet<VisualElement> GetPage(VisualElement parent)

RegisterElement

csharp
public void RegisterElement(VisualElement parent, VisualElement item)

UnregisterElement

csharp
public void UnregisterElement(VisualElement parent, VisualElement item)

Global UIView Registry

The Global UIView Registry tracks all UIViews in the scene, enabling you to apply USS classes to all views at once. This is particularly useful for locale-based styling and runtime USS class management.

Public Methods

GetAllUIViews

Returns a read-only collection of all registered UIViews in the scene. Automatically removes invalid views (where ParentElement is null or destroyed).

csharp
public IReadOnlyCollection<UIView> GetAllUIViews()

AddClassToAllUIViews

Adds a USS class to the root element of all registered UIViews. The class will be automatically applied to any UIViews that register in the future.

csharp
public void AddClassToAllUIViews(string className)

Use Case: Locale-based styling, runtime USS class management. See Runtime Style Switching for an example.

RemoveClassFromAllUIViews

Removes a USS class from the root element of all registered UIViews. The class will no longer be applied to UIViews that register in the future.

csharp
public void RemoveClassFromAllUIViews(string className)

RegisterUIView

Info: You don't need to manually register UIViews. Registration happens automatically when a UIView is constructed.

However, for documentation purposes, the function is detailed here.

Registers a UIView to the global registry. Applies any globally tracked classes to the newly registered view.

csharp
public void RegisterUIView(UIView view)

UnregisterUIView

Info: You typically don't need to manually unregister UIViews. Unregistration happens automatically when a UIView is destroyed via UIViewReference.OnDestroy().

However, for documentation purposes, the function is detailed here.

Unregisters a UIView from the global registry.

csharp
public void UnregisterUIView(UIView view)

Settings

Theme

Light

Contrast

Material

Dark

Dim

Material Dark

System

Sidebar(Light & Contrast only)

Light
Dark

Font Family

DM Sans

Wix

Inclusive Sans

AR One Sans

Direction

LTR
RTL