/// <summary> /// GUI displayed when the user is authenticated and we have an active match loaded /// </summary> private void authenticatedWithActiveMatchGUI() { GUILayout.Label("Match Status: " + currentMatch.status + ", Description: " + currentMatch.matchDescription); // is it our turn? if (currentMatch.isLocalPlayersTurn) { GUILayout.Label("It is Our Turn"); if (GUILayout.Button("Take Turn")) { GPGTurnBasedMultiplayer.takeTurn(currentMatch.matchId, getMatchDataWithNewDataAppended(), getPendingParticipantId()); currentMatch = null; } if (GUILayout.Button("Finish Match Without Data")) { GPGTurnBasedMultiplayer.finishMatchWithoutData(currentMatch.matchId); currentMatch = null; } if (GUILayout.Button("Finish Match With Data")) { var results = new List <GPGTurnBasedParticipantResult>(); // we will need to create a GPGTurnBasedParticipantResult for each player in the match // for demonstration purposes we will just set the result to Tie foreach (var player in currentMatch.players) { results.Add(new GPGTurnBasedParticipantResult(player.participantId, GPGTurnBasedParticipantResultStatus.Tie)); } GPGTurnBasedMultiplayer.finishMatchWithData(currentMatch.matchId, getMatchDataWithNewDataAppended(), results); currentMatch = null; } if (GUILayout.Button("Leave Match During Turn")) { GPGTurnBasedMultiplayer.leaveDuringTurn(currentMatch.matchId, getPendingParticipantId()); currentMatch = null; } dismissMatchGuiButton(); } else { GUILayout.Label("It is Not Our Turn"); if (GUILayout.Button("Leave Match Out of Turn")) { GPGTurnBasedMultiplayer.leaveOutOfTurn(currentMatch.matchId); currentMatch = null; } dismissMatchGuiButton(); } }