using System; namespace LobbyRelaySample { /// /// Current state of the local game. /// Set as a flag to allow for the Inspector to select multiple valid states for various UI features. /// [Flags] public enum GameState { Menu = 1, Lobby = 2, JoinMenu = 4, } /// /// Awaits player input to change the local game data. /// [System.Serializable] public class LocalMenuState : Observed { GameState m_State = GameState.Menu; public GameState State { get => m_State; set { if (m_State != value) { m_State = value; OnChanged(this); } } } public override void CopyObserved(LocalMenuState oldObserved) { if (m_State == oldObserved.State) return; m_State = oldObserved.State; OnChanged(this); } } }