Game.Debug.ThumbnailsDebugUI
Assembly: Assembly-CSharp (game assembly)
Namespace: Game.Debug
Type: static class
Base: System.Object
Summary: A small debug UI container used by the game's debug UI system to expose thumbnail-related debug controls. It registers a "Thumbnails" debug tab (via attribute) and, when the game's ThumbnailCache is available, builds a single "Refresh" button that invokes ThumbnailCache.Refresh() to force regeneration/refetch of thumbnails. The class is attribute-driven and relies on the game's debug UI discovery to surface the controls.
Fields
None
This static class declares no fields.
Properties
None
There are no properties on this class.
Constructors
None (static class)
As a static class, there are no instance constructors. The compiler may emit a static constructor if needed, but none is defined in source.
Methods
private static System.Collections.Generic.List<DebugUI.Widget> BuildThumbnailsDebugUI()
- Attributes:
[DebugTab("Thumbnails", 0)]
- Summary: Method used by the debug UI discovery system to build the contents of the "Thumbnails" debug tab. It checks for the game's thumbnail cache (GameManager.instance?.thumbnailCache). If the cache exists, it creates a Foldout (display name "Thumbnails") and returns a list containing a single DebugUI.Button whose action calls ThumbnailCache.Refresh(). If the thumbnail cache is not available, the method returns null (no tab content).
- Notes:
- The method is private and static, intended to be discovered via the DebugTab attribute rather than called directly.
- The method returns null when there is no thumbnail cache to avoid showing a broken or empty UI.
- Dependencies: DebugUI types (DebugUI.Widget, DebugUI.Button, DebugUI.Foldout), the DebugTab/DebugContainer attributes, GameManager, and ThumbnailCache.
- The file includes an unused using of UnityEngine.Rendering (can be removed safely).
Usage Example
// The debug system will call BuildThumbnailsDebugUI automatically because of the attributes.
// From code you can achieve the same effect manually by invoking the thumbnail cache refresh:
GameManager.instance?.thumbnailCache?.Refresh();
// The class' original code builds a button in the debug UI that does exactly the above when clicked:
[DebugTab("Thumbnails", 0)]
private static List<DebugUI.Widget> BuildThumbnailsDebugUI()
{
ThumbnailCache tc = GameManager.instance?.thumbnailCache;
if (tc != null)
{
new DebugUI.Foldout().displayName = "Thumbnails";
return new List<DebugUI.Widget>
{
new DebugUI.Button
{
displayName = "Refresh",
action = delegate
{
tc.Refresh();
}
}
};
}
return null;
}
{{ Additional notes: - This class is strictly for debug/developer tooling and should not be required by normal gameplay. - Ensure GameManager.instance is initialized before relying on the debug tab; otherwise BuildThumbnailsDebugUI returns null and no UI is shown. - If you extend or reuse this pattern: the debug system discovers methods by attributes, so matching signatures and attribute usage is important. }}