UIElementManager

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. Additionally, it includes functionality for setting a blocker element.

Public Methods

SetBlocker

public void SetBlocker(VisualElement blocker)
public void SetBlocker(string elementName)

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.

RegisterPage

public void RegisterPage(VisualElement parent)

Add all interactable visual elements in parent to the manager. UIView calls this automatically when it fades in, so in most cases you don't need to bother with this.

UnregisterPage

public void UnregisterPage(VisualElement parent)

Remove all interactable visual elements in parent from the manager. UIView calls this automatically when it fades out, so in most cases you don't need to bother with this.

GetPageElements

public List<VisualElement> GetPageElements(VisualElement parent)

Retrieves the list of registered VisualElement children for the parent.

RegisterElement

public void RegisterElement(VisualElement parent, VisualElement element)

Add a single visual element to the manager.

UnregisterElement

public void RegisterElement(VisualElement parent, VisualElement element)

Remove a single visual element from the manager.

DisableAll

public void DisableAll()

Disables all registered VisualElement instances.

EnableAll

public void EnableAll()

Enables all registered VisualElement instances.

Last updated