Skip to main content

Panel

A class in Root.Township, Alta.Meta.UI.

One page of a meta UI Window. Shows or hides itself, playing an optional scale animation, and raises StateChanged.

Constructors​

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

Fields​

MemberWhat it is
protected static Logger loggerNLog logger shared by panels.
2 private and internal fields
MemberWhat it is
private CurveScaler animationScaler animation used to show and hide the panel; without one it toggles after 50 ms.
private Window windowBacking field for Window.

Properties​

MemberWhat it is
bool IsActive { get; private set; }Whether the panel is currently shown.
Window Window { get; }The window that owns this panel.

Events​

MemberWhat it is
event Action<Panel> StateChangedRaised when the panel is shown or hidden.

Methods​

MemberWhat it is
void SetActive(bool state)Shows or hides the panel and raises StateChanged. Logs a warning and does nothing if already in that state.
void SetActive(bool state, Action onFinished = null)Shows or hides the panel and raises StateChanged. Logs a warning and does nothing if already in that state.
void SwitchTo()Asks the parent window to switch to this panel.
protected virtual async void InternalSetState(bool state, Action onFinished = null)Turns the object on or off, through the animation if set, otherwise after a 50 ms delay, then calls the finish callback.

Used in​

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