using UnityEngine; namespace LobbyRelaySample.UI { [RequireComponent(typeof(LocalGameStateObserver))] public class GameStateVisibilityUI : ObserverPanel { [SerializeField] GameState ShowThisWhen; public override void ObservedUpdated(LocalGameState observed) { if (!ShowThisWhen.HasFlag(observed.State)) Hide(); else { Show(); } } } }