using UnityEngine; namespace LobbyRelaySample.UI { /// /// Show or hide a UI element based on the current GameState (e.g. in a lobby). /// [RequireComponent(typeof(LocalMenuStateObserver))] public class GameStateVisibilityUI : ObserverPanel { [SerializeField] GameState ShowThisWhen; public override void ObservedUpdated(LocalMenuState observed) { if (!ShowThisWhen.HasFlag(observed.State)) Hide(); else { Show(); } } } }