An abstract class in Root.Township, the global namespace.
Base for debug UI widgets that hide themselves unless enabled. Each picks an activation type: always on, toggled through SetActive (the QAM), or on when a DebugWidgets file is in the storage folder.
Constructors
| Member | What it is |
|---|
protected DebugWidget() | Unity makes components itself; use AddComponent or spawn a prefab instead of new. |
Fields
3 private and internal fields
| Member | What it is |
|---|
private DebugWidget.ActivationType activationType | How this widget is turned on: always, by the QAM, or by the debug file. |
private static HashSet<DebugWidget> awokenWidgets | All widgets that have woken, for SetActive. |
private static bool? hasWidgetFile | Cached result for HasWidgetFile. |
Properties
1 private and internal property
| Member | What it is |
|---|
private static bool HasWidgetFile { get; } | Whether a DebugWidgets file exists in the storage folder; checked once. |
Methods
| Member | What it is |
|---|
static void SetActive(bool isActive) | Shows or hides every widget set to QAM activation. Called by SceneWidgetsAction. |
2 private and internal methods
| Member | What it is |
|---|
private void Awake() | Registers the widget and hides it if it is QAM-only, or file-only with no DebugWidgets file. |
private void OnDestroy() | Removes the widget from the registered set. |