Public Member Functions | |
void | startLoadingGameResourcesFor (string gameId) |
void | provideGameControllerWithStartGameInfo (EAZGameStartInfo startGameInfo) |
void | didEndGame () |
void | didReceiveOpponentsScore (long opponentScore) |
void | waitingForOpponent () |
void | didStartPlaying () |
void | SendScore (long gameScore) |
void | FinishGame (long finalScore) |
void | LeaveGame () |
Static Public Member Functions | |
static void | EndGame () |
Static Public Attributes | |
static GamePreparationManager | instance |
static List< int > | levelList = new List<int>() |
static int | currentLevel = 0 |
static long | currentScore = 0 |
static long | oppScore = 0 |
static bool | playing = false |
static int | endDate = 0 |
static int | gameDuration = 0 |
Events | |
static System.Action | DidEndGameEvent |
static System.Action | WaitingForOpponentEvent |
static System.Action< long > | DidReceiveOpponentsScoreEvent |
static System.Action< EAZGameStartInfo > | DidReceiveStartGameInfo |
Private Member Functions | |
void | Awake () |
void | OnSceneLoaded (Scene arg0, LoadSceneMode arg1) |
void | gameDidLoad () |
void | OnApplicationPause (bool pause) |
Static Private Member Functions | |
static void | OnTokenReceived (object sender, TokenReceivedEventArgs token) |
Definition at line 26 of file GamePreparationManager.cs.
|
private |
Following code snippet sets the GamePreparationDelegate that indicates the start of game preparation sequence and manages it.
Definition at line 86 of file GamePreparationManager.cs.
void GamePreparationManager.didEndGame | ( | ) |
Callback from Platform about final completion gameplay sequence.
Definition at line 196 of file GamePreparationManager.cs.
void GamePreparationManager.didReceiveOpponentsScore | ( | long | opponentScore | ) |
Informs about opponent’s score. In case of tournament ( multiple opponents), it will send the highest score among all the opponents.
long | $opponentScore | opponent’s score. |
Definition at line 208 of file GamePreparationManager.cs.
void GamePreparationManager.didStartPlaying | ( | ) |
Method that lets platform know that player has started gameplay sequence so it should handle gameplay messages
Definition at line 233 of file GamePreparationManager.cs.
|
static |
Method which defines every runtime gameplay variables with default values.
Definition at line 297 of file GamePreparationManager.cs.
void GamePreparationManager.FinishGame | ( | long | finalScore | ) |
Informs Platform that user finished playing with provided final score.
long | $finalScore | The last acquired score in current game sequence. |
Definition at line 253 of file GamePreparationManager.cs.
|
private |
Application is ready to launch gameplay sequence
Definition at line 133 of file GamePreparationManager.cs.
void GamePreparationManager.LeaveGame | ( | ) |
Triggers GamePlayManager leaveGame event for user to leave game sequence.
Definition at line 261 of file GamePreparationManager.cs.
|
private |
Code snippet, written to handle situation when user lost focus on application but haven't fold it.
Load initial or loading scene when user opens game window after collapsing so game could run from scratch on starting new game sequence without showing last game scene.
Definition at line 282 of file GamePreparationManager.cs.
|
private |
Definition at line 110 of file GamePreparationManager.cs.
|
staticprivate |
Custom event handler, that fires when Firebase token has been received.
Definition at line 271 of file GamePreparationManager.cs.
void GamePreparationManager.provideGameControllerWithStartGameInfo | ( | EAZGameStartInfo | startGameInfo | ) |
Callback from server with gameplay start configuration telling that application should launch gameplay sequence
EAZGameStartInfo | startGameInfo Contains information about game, that is about to start. |
In this callback string level sequence must be parsed into list of integer levels indexes levelList.
In order to show user the proper time left, in case an application collapses or loses focus, sequence endDate can be saved for timer and compared with current game sequence initial start date, using provided Epoch class.
Executed in order to start receive callbacks from platform regarding runtime gameplay sequence.
Definition at line 166 of file GamePreparationManager.cs.
void GamePreparationManager.SendScore | ( | long | gameScore | ) |
Updates player score on platform
long | $gameScore | The current score aсquired in current game sequence. |
Definition at line 243 of file GamePreparationManager.cs.
void GamePreparationManager.startLoadingGameResourcesFor | ( | string | gameId | ) |
Ability to load additional necessary resources before gameplay sequence launch
gameId | gives id of game to load resources for |
Definition at line 141 of file GamePreparationManager.cs.
void GamePreparationManager.waitingForOpponent | ( | ) |
This callback will fire in case when there is a need to wait for opponent to finish playing in Live game.
Definition at line 220 of file GamePreparationManager.cs.
|
static |
Current level index.
Definition at line 55 of file GamePreparationManager.cs.
|
static |
Current player's score.
Definition at line 59 of file GamePreparationManager.cs.
|
static |
Calculated ending point of gameplay sequence.
Definition at line 71 of file GamePreparationManager.cs.
|
static |
Game duration provided by Platform to find out how long should game sequence last in seconds.
Definition at line 75 of file GamePreparationManager.cs.
|
static |
Static GamePreparationManager instance.
Definition at line 31 of file GamePreparationManager.cs.
|
static |
Parsed into list of integer indexes level sequence string.
Definition at line 51 of file GamePreparationManager.cs.
|
static |
Current opponent's score
Definition at line 63 of file GamePreparationManager.cs.
|
static |
Indicates that application is ready to launch gameplay sequence
Definition at line 67 of file GamePreparationManager.cs.
|
static |
Custom didEndGame callback handler for GamePlayManager.
Definition at line 35 of file GamePreparationManager.cs.
|
static |
Custom didReceiveOpponentsScoreEvent callback handler for GamePlayManager.
Definition at line 43 of file GamePreparationManager.cs.
|
static |
Custom didReceiveStartGameInfo callback handler for GamePlayManager.
Definition at line 47 of file GamePreparationManager.cs.
|
static |
Custom waitingForOpponent callback handler for GamePlayManager.
Definition at line 39 of file GamePreparationManager.cs.