An abstract class in Root.Township, Alta.Meta.UI.
Base for components that fill a meta UI Panel with data. Refreshes when the panel opens if marked stale, and marks itself stale on a timer (30 seconds by default).
- Listed in Menus, UI and platforms
- Inherits or implements
MonoBehaviour
- Derived types
FriendsInvitesPanel, FriendsListPanel, FriendsRequestsPanel, GroupPage, InboxPanel, InviteUserToGroupPanel, InviteUserToGroupViaFriendsPanel, JoinedGroupsList, OculusFriendsListPanel, RecentPlayersListPanel, ReportsPanel, ServerDetailsPanel, RecentPlayersPage, GymnasiumTeleportPointPage, RecentPlayerActionPage
Constructors
| Member | What it is |
|---|
protected PanelComponent() | Unity makes components itself; use AddComponent or spawn a prefab instead of new. |
Fields
| Member | What it is |
|---|
protected static Logger logger | NLog logger shared by panel components. |
protected bool needsToRefreshData | True when data should be reloaded on the next panel state change. |
protected Panel panel | The panel this component belongs to (set in the editor). |
2 private and internal fields
| Member | What it is |
|---|
private Timeline.IEntry entry | The scheduled refresh on the Timeline. |
private float refreshTimer | Seconds between automatic data refreshes. Default 30; 0 or less turns them off. |
Properties
| Member | What it is |
|---|
Panel Panel { get; } | The panel this component belongs to. |
Methods
| Member | What it is |
|---|
void ForceRefreshOnNextLoad() | Refreshes now if the panel is open, otherwise refreshes the next time it opens. |
virtual void RefreshData() | Override to reload the panel's data. Empty in the base. |
protected virtual void HandleStateChange(Panel panel) | Hook for subclasses, called each time the panel opens or closes. |
4 private and internal methods
| Member | What it is |
|---|
private void Awake() | Hooks the panel's state changes and, if refreshTimer is above 0, schedules RefreshAgain. |
private void HandlePanelStateChange(Panel panel) | On any panel state change: runs RefreshData if a refresh is pending, then HandleStateChange. |
private void OnDestroy() | Cancels the scheduled refresh. |
private void RefreshAgain() | Timer callback: refreshes now if the panel is open, otherwise on next open, then schedules itself again. |
Used in
Members of other types that take, return or hold a PanelComponent: