Definition at line 7 of file GamePlayManager.cs.
◆ EndGame()
void GamePlayManager.EndGame |
( |
| ) |
|
|
private |
Suggested custom method to be called when it is time to complete gameplay sequence or player leaves game via "Leave" button.
- Note
- It's important to delete runtime values and make sure that all gameplay freezes on game sequence end, because application is still running in background when SDK UI is shown.
Definition at line 130 of file GamePlayManager.cs.
◆ Finish()
void GamePlayManager.Finish |
( |
long |
score | ) |
|
|
private |
Suggested custom method to be called when it is time to finish gameplay sequence with defining last score and sending it to the platform
- Parameters
-
long | $score | Last gained by player score. |
Definition at line 143 of file GamePlayManager.cs.
◆ LeaveGame()
void GamePlayManager.LeaveGame |
( |
| ) |
|
◆ OnDisable()
void GamePlayManager.OnDisable |
( |
| ) |
|
|
private |
In this method custom Platform callback handlers might be removed, so they won't be duplicated on level switch.
Definition at line 45 of file GamePlayManager.cs.
◆ OnEnable()
void GamePlayManager.OnEnable |
( |
| ) |
|
In this method custom Platform callback handlers might be set, so they are ready just before game start
Definition at line 38 of file GamePlayManager.cs.
◆ Start()
void GamePlayManager.Start |
( |
| ) |
|
|
private |
Suggested place for setting up the timer and other UI text objects, like opponent's score, player's score etc with proper up-to-date values, on gameplay sequence start or on new level loaded. Also "Leave" button click handler might be defined here.
Definition at line 78 of file GamePlayManager.cs.
◆ Update()
void GamePlayManager.Update |
( |
| ) |
|
|
private |
Default Unity event handler. Suggested place ṭo show actual game timer value every second/every frame in order to get around the possibility of incorrect timer value on game window collapse or losing focus
Definition at line 90 of file GamePlayManager.cs.
◆ UpdateOpponentsScore()
void GamePlayManager.UpdateOpponentsScore |
( |
long |
opponentsScore | ) |
|
Suggested custom Platform callback handler, that will fire when opponent's score is changed.
- Parameters
-
long | $opponentsScore | New opponent's score value. |
Definition at line 53 of file GamePlayManager.cs.
55 OppScore.text =
"Opponent : " + opponentsScore;
◆ UpdateScore()
void GamePlayManager.UpdateScore |
( |
long |
score | ) |
|
|
private |
Suggested custom method to call from main gameplay logic to pass new score value to UI score text object and pass this value to Platform.
- Parameters
-
long | $score | New player's score value. |
Definition at line 62 of file GamePlayManager.cs.
65 Score.text =
"Score : " + score.ToString();
◆ gameEnded
bool GamePlayManager.gameEnded = false |
|
private |
Variable to let application know whether current gameplay sequence is over or not.
Definition at line 104 of file GamePlayManager.cs.
◆ leave
Button GamePlayManager.leave |
|
private |
Suggested button object for player's leave game mechanics.
Definition at line 24 of file GamePlayManager.cs.
◆ OppScore
Text GamePlayManager.OppScore |
|
private |
◆ Score
Text GamePlayManager.Score |
|
private |
◆ timer
Text GamePlayManager.timer |
|
private |
Suggested timer text object to show player time left till game sequence end.
Definition at line 20 of file GamePlayManager.cs.