/// <summary> /// Matchmaking state-machine driver /// </summary> /// <exception cref="ArgumentOutOfRangeException"></exception> public void Update() { switch (State) { case MatchmakingState.Requesting: matchmakingController.UpdateRequestMatch(); break; case MatchmakingState.Searching: matchmakingController.UpdateGetAssignment(); break; case MatchmakingState.Found: case MatchmakingState.Error: break; // User hasn't stopped the state machine yet. default: throw new ArgumentOutOfRangeException(); } }
/// <summary> /// Matchmaking state-machine driver /// </summary> /// <exception cref="ArgumentOutOfRangeException"></exception> public void Update() { switch (State) { case MatchmakingState.Requesting: matchmakingController.UpdateRequestMatch(); break; case MatchmakingState.Searching: matchmakingController.UpdateGetAssignment(); break; case MatchmakingState.Found: case MatchmakingState.Error: Debug.Log("Update() is still being called after matchmaking finished."); break; default: throw new ArgumentOutOfRangeException(); } }