Usage
Add
DubbzAdapter.prefab
: Place theDubbzAdapter.prefab
(found atAssets > DubbzSDK > Prefabs > DubbzAdapter.prefab
) on the first loaded scene of your game, typically the main menu.Create a Challenge Button: On the main menu screen, create a button labeled “Challenge.” This will be the user's entry point to the wagering functionality.
Singleton Access: The
DubbzAdapter
acts as a singleton and can be accessed from any scene within your game. The SDK initializes itself on theAwake
method of the prefab.Implementing Methods and Events:
Open Challenge: Use
DubbzAdapter.OpenChallenge()
when the user clicks the “Challenge” button. This method opens up the challenge UI for the player.Subscribe to CreatedArcadeMatch Event: Listen for the
DubbzAdapter.CreatedArcadeMatch
event. When this event is triggered, integrate your match start logic using thegameId
andtournamentId
parameters received.Track Match Start: After receiving the
CreatedArcadeMatch
event and successfully initiating a match on your server, callDubbzAdapter.TrackMatchStart(string tournamentId, Action onSuccess, Action onError)
. This confirms the match start with Dubbz.Cancel Match: If there's a failure in any response sent to your server during match start, use
DubbzAdapter.CancelMatch(string tournamentId)
to cancel the match.Set Active Dubbz Widget: Control the visibility of the Dubbz widget in your game UI with
DubbzAdapter.SetActiveDubbzWidget(bool active)
. Set totrue
to show andfalse
to hide the widget.Show Match Result: Once the match concludes, call
DubbzAdapter.ShowMatchResult()
to display the Dubbz SDK “Match Results” screen to the players.
Last updated