LiveDataDisplayView
A class in Root.Township, Alta.Utilities.Profiling.
Client: the on-screen debug readout (FPS and similar stats) on the player. Toggled by the DisplayFPS controller action for users with the debug_features permission.
- Listed in Utilities and other Alta namespaces
- Inherits or implements
MonoBehaviour
Constructors
| Member | What it is |
|---|---|
LiveDataDisplayView() | Unity makes components itself; use AddComponent or spawn a prefab instead of new. |
Fields
11 private and internal fields
| Member | What it is |
|---|---|
private TextRenderer androidOnScreenText | Text renderer used on Android. |
private LiveDataDisplayCollection dataDisplays | The set of data displays to run and show. |
private string lastDisplay | Last text shown, to skip unchanged updates. |
private static readonly Logger logger | NLog logger. |
private Text pcScreenText | UI text used on PC. |
private PlayerController playerController | The player this view is on; found in a parent. |
private readonly StringBuilder stringBuilder | Reused builder for the display text. |
private float textUpdateInterval | Seconds between text refreshes. |
private float textUpdateTime | Time since the last text refresh. |
private float updateInterval | Seconds between data display updates. |
private float updateTime | Time since the last data display update. |
Methods
| Member | What it is |
|---|---|
void ToggleFPSDisplay(PlayerInput controller = null) | Turns the readout on or off, if Shift isn't held and the user has the debug_features permission. |
10 private and internal methods
| Member | What it is |
|---|---|
private string GetText() | Joins the output of every valid data display into one string, one per line. |
private void OnDisable() | Calls each data display's disable hook. |
private void OnEnable() | Calls each data display's enable hook. |
private void RunDataAction(Action<LiveDataDisplayBase> action, Predicate<LiveDataDisplayBase> predicate = null) | Runs an action on every data display that passes an optional filter; warns if no displays are set. |
private void SetScreenText(string screenText) | Shows text on the Android text renderer or the PC UI text, skipping it if unchanged. |
private void SetScreenTextActive(bool active) | Shows or hides the Android or PC text object. |
private void Start() | Hooks the left controller's DisplayFPS action and starts disabled with the text hidden. |
private void Update() | Updates the data displays and the shown text on their intervals. |
private void UpdateDataDisplay() | Rebuilds and shows the text every textUpdateInterval seconds. |
private void UpdateDataInternals() | Runs each valid data display's internal update every updateInterval seconds. |
Used in
Members of other types that take, return or hold a LiveDataDisplayView: