Inventool Confirm Prompt

❓ InventoolConfirmPrompt Class

A pop-up element that prompts the user to select an option.

Namespace: Esper.Inventool.UI Access: public Type: class Inherits: CrossInputSupportedWindow


📦 Fields

Access
Field
Type
Description

protected

root

VisualElement

The root element of the prompt.

protected

hiddenCloseButton

Button

Full-screen invisible close button.

protected

titleLabel

Label

The prompt title label.

protected

descriptionLabel

Label

The prompt description label.

protected

leftButton

Button

The left button option.

protected

rightButton

Button

The right button option.

protected

leftButtonIconElement

VisualElement

Icon element for the left button.

protected

rightButtonIconElement

VisualElement

Icon element for the right button.

protected

leftButtonLabel

Label

Label for the left button.

protected

rightButtonLabel

Label

Label for the right button.

protected

spacing

VisualElement

Spacing element between buttons.

protected

leftButtonAction

Action

Callback for left button click.

protected

rightButtonAction

Action

Callback for right button click.


🔍 Properties

Access
Property
Type
Description

public

LeftButtonColor

Color

Background color of the left button.

public

RightButtonColor

Color

Background color of the right button.

public static

Instance

InventoolConfirmPrompt

Active singleton instance.


🧰 Methods

Access
Method
Returns
Description

protected override

Awake()

void

Initialize singleton, cache UI elements, and wire events.

public virtual

Open(string title, string description, Action leftButtonAction = null, Action rightButtonAction = null, bool showLeftButton = true, bool showRightButton = true, string leftButtonText = "Cancel", string rightButtonText = "Confirm", Sprite leftButtonIcon = null, Sprite rightButtonIcon = null, bool leftLabelIsNumeric = false, bool rightLabelIsNumeric = false)

void

Display the prompt with specified text, icons, and actions.

public virtual

Close()

void

Disable input and begin prompt closing animation.

protected virtual

OnClosed(TransitionEndEvent endEvent)

void

Hide prompt after transition and invoke close callbacks.

Active Instance

You can get the active InventoolConfirmPrompt instance with InventoolConfirmPrompt.Instance. Ensure there's an instance of it in your scene before using this field.

Open

The Open method has many parameters you can use to customize what's displayed on the confirm prompt.

Name
Description
Type

title

The prompt title or the localized string key if you're using localization.

string

description

The prompt description or the localized string key if you're using localization.

string

leftButtonAction

The left button on-click action.

Action

rightButtonAction

The right button on-click action.

Action

showLeftButton

If the left button should be displayed.

bool

showRightButton

If the right button should be displayed.

bool

leftButtonText

The left button text or the localized string key if you're using localization.

string

rightButtonText

The right button text or the localized string key if you're using localization.

string

leftButtonIcon

The left button icon.

Sprite

rightButtonIcon

The right button icon.

Sprite

leftLabelIsNumeric

If the left label is numeric (localization disabled).

bool

rightLabelIsNumeric

If the right label is numeric (localization disabled).

bool

InventoolConfirmPrompt.Instance.Open("My Title", "My Description");

Close

InventoolConfirmPrompt.Instance.Close();

Last updated