PlayPad communication
PlayPadCommunicator
PlayPadCommunicator
aggregates all the necessary interface implementations for external communication.
This works a little differently in the final PlayPad environment and in the Editor.
In the Editor you do not access majority of our services but use default, mock implementations instead.
For example, while in the Editor, you cannot play in a tournament and get your score to its leaderboard.
Displayed data consists of default values meant only for basic testing.
If you need anything more elaborate, you can provide your own implementation.
An instance of the PlayPadCommunicator
component is included in the PlayPadCommunicator
prefab, which should be included in the lobby scene.
That instance is accessible through the PlayPadCommunicator.Instance
field after the MonoBehaviour.Awake
method executes on it.
The remaining sections of this article describe the most important fields of the PlayPadCommunicator
class,
which contain instances of different classes implementing interfaces responsible for communicating with PlayPad
to utilize different features it offers.
ExternalAuthenticator
Contains events and methods related to authentication and regions.
Most of the time, using the SessionManager
class is a better approach than accessing the IExternalAuthenticator
interface directly.
GameStatusCommunicator
Contains events and methods that make implementing a "Play" button for social tournaments easier. For more information about how a "Play" button should behave in social tournaments see the related section of the manual integration guide
Remeber that IExternalGameStatusCommunicator
works only with social tournaments.
If you want to start a match outside of a social tournament or use a different type of competitiveness, such as duels or instant tournaments,
the IExternalGameStatusCommunicator.PlayGame
method won't be suitable and you'll have to use IRoomsManager.StartQuickMatch
instead or
use the room and matchmaking systems directly.
ExternalUiCommunicator
Contains methods that allow opening different modal windows in PlayPad. All of those modal windows are opened by PlayPad over the game and allow the user to interact with PlayPad directly, though its native UI.
TournamentCommunicator
Members of this type allow fetching data about social tournaments and instant tournaments, as well as setting the current active social tournament through the SetActiveTournament
method.
LeaderboardCommunicator
Exposes tournament leaderboards, as well as user's all-time high score.
VirtualDepositCommunicator
Gives access to user's battle wallet.