Skip to main content

PopupBoard

A class in Root.Township, the global namespace.

A world space popup with a title and a message. Destroys its own GameObject when closed, unless set not to.

Constructors​

MemberWhat it is
PopupBoard()Unity makes components itself; use AddComponent or spawn a prefab instead of new.

Fields​

3 private and internal fields
MemberWhat it is
private bool destroyGameObjectOnCloseWhether Close destroys the board's game object (default true).
private TextRenderer messageTextText renderer behind Message.
private TextRenderer titleTextText renderer behind Title.

Properties​

MemberWhat it is
string Message { get; set; }The body text shown on the popup.
string Title { get; set; }The title text shown on the popup.
Transform Transform { get; }The popup's transform, so callers can place it.

Events​

MemberWhat it is
event Action<IPopupBoard> ClosedRaised when Close is called, before the popup is destroyed.

Methods​

MemberWhat it is
void Close()Raises Closed, then destroys the popup's GameObject if it's set to.
override string ToString()Returns the popup's title and object name, for logs.

Used in​

Members of other types that take, return or hold a PopupBoard: