using System.Collections.Generic;
using UnityEngine;
using UnityEngine.InputSystem;
namespace Ashwild.UI
{
///
/// Screenshot/capture utility: one keypress hides (and restores) every Canvas in the scene at
/// once, so the world can be photographed with no HUD, crosshair, notifications or menus on top.
/// It toggles each root Canvas's rather than deactivating GameObjects,
/// so animations, timers and gameplay keep running untouched behind the hidden UI.
///
/// This is a deliberate, isolated exception to the "InputManager owns all input" rule: it is not a
/// gameplay action and never goes through the Send-Messages path, so it reads the key straight from
/// instead of the action asset. Canvases are re-queried on every toggle, so
/// windows opened after hiding are still caught the next time the state flips.
///
[DisallowMultipleComponent]
public class HudVisibilityToggle : MonoBehaviour
{
#region Serialized Fields
[Header("Input")]
[Tooltip("Key that toggles all UI on/off (default F8).")]
[SerializeField] private Key toggleKey = Key.F8;
[Header("Exclusions")]
[Tooltip("Root canvases that must stay visible even when the HUD is hidden (e.g. a debug overlay).")]
[SerializeField] private List