Tanks Multiplayer  1.5
Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
GameManager

Manages game workflow and provides high-level access to networked logic during a game. It manages functions such as team fill, scores and ending a game, but also video ad results. More...

Inheritance diagram for GameManager:

Public Member Functions

int GetTeamFill ()
 Returns the next team index a player should be assigned to. More...
 
Vector3 GetSpawnPosition (int teamIndex)
 Returns a random spawn position within the team's spawn area. More...
 
void AddScore (ScoreType scoreType, int teamIndex)
 Adds points to the target team depending on matching game mode and score type. This allows us for granting different amount of points on different score actions. More...
 
bool IsGameOver ()
 Returns whether a team reached the maximum game score. More...
 
void DisplayDeath (bool skipAd=false)
 Only for this player: sets the death text stating the killer on death. If Unity Ads is enabled, tries to show an ad during the respawn delay. By using the 'skipAd' parameter is it possible to force skipping ads. More...
 
void DisplayGameOver (int teamIndex)
 Only for this player: sets game over text stating the winning team. Disables player movement so no updates are sent through the network. More...
 

Static Public Member Functions

static GameManager GetInstance ()
 Returns a reference to this script instance. More...
 
static bool isMaster ()
 Global check whether this client is the match master or not. More...
 

Public Attributes

Player localPlayer
 The local player instance spawned for this client. More...
 
GameMode gameMode = GameMode.TDM
 Active game mode played in the current scene. More...
 
UIGame ui
 Reference to the UI script displaying game stats. More...
 
Team[] teams
 Definition of playing teams with additional properties. More...
 
int maxScore = 30
 The maximum amount of kills to reach before ending the game. More...
 
int respawnTime = 5
 The delay in seconds before respawning a player after it got killed. More...
 
bool friendlyFire = false
 Enable or disable friendly fire. This is verified in the Bullet script on collision. More...
 

Detailed Description

Manages game workflow and provides high-level access to networked logic during a game. It manages functions such as team fill, scores and ending a game, but also video ad results.

Member Function Documentation

void AddScore ( ScoreType  scoreType,
int  teamIndex 
)

Adds points to the target team depending on matching game mode and score type. This allows us for granting different amount of points on different score actions.

void DisplayDeath ( bool  skipAd = false)

Only for this player: sets the death text stating the killer on death. If Unity Ads is enabled, tries to show an ad during the respawn delay. By using the 'skipAd' parameter is it possible to force skipping ads.

void DisplayGameOver ( int  teamIndex)

Only for this player: sets game over text stating the winning team. Disables player movement so no updates are sent through the network.

static GameManager GetInstance ( )
static

Returns a reference to this script instance.

Vector3 GetSpawnPosition ( int  teamIndex)

Returns a random spawn position within the team's spawn area.

int GetTeamFill ( )

Returns the next team index a player should be assigned to.

bool IsGameOver ( )

Returns whether a team reached the maximum game score.

static bool isMaster ( )
static

Global check whether this client is the match master or not.

Member Data Documentation

bool friendlyFire = false

Enable or disable friendly fire. This is verified in the Bullet script on collision.

GameMode gameMode = GameMode.TDM

Active game mode played in the current scene.

Player localPlayer

The local player instance spawned for this client.

int maxScore = 30

The maximum amount of kills to reach before ending the game.

int respawnTime = 5

The delay in seconds before respawning a player after it got killed.

Team [] teams

Definition of playing teams with additional properties.

UIGame ui

Reference to the UI script displaying game stats.


The documentation for this class was generated from the following file: