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...
|
override void | OnStartServer () |
| Server only: initialize SyncList length with team size once. Also verifies the team fill for each team in case of host migration. More...
|
|
override void | OnStartClient () |
| On establishing a successful connection to the master and initializing client variables, update the game UI, i.e. team fill and scores, by looping over the received SyncLists. More...
|
|
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...
|
|
int | AddBufferedCollectible (NetworkInstanceId id, Vector3 position, NetworkInstanceId tarId) |
| Add Collectible to the networked buffered list for tracking it on all clients. This method actually checks whether the Collectible is existent already and then modifies that entry, before adding it. The object ID has to be assigned in all cases, but the other parameters depend on the state. More...
|
|
void | OnCollectibleStateChanged (SyncListStruct< CollectibleState >.Operation op, int index) |
| Method called by the SyncList operation over the Network when its content changes. This is an implementation for changes to the buffered Collectibles, updating their position and assignment. Parameters: type of operation, index of Collectible which received updates. 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...
|
|
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.
int AddBufferedCollectible |
( |
NetworkInstanceId |
id, |
|
|
Vector3 |
position, |
|
|
NetworkInstanceId |
tarId |
|
) |
| |
Add Collectible to the networked buffered list for tracking it on all clients. This method actually checks whether the Collectible is existent already and then modifies that entry, before adding it. The object ID has to be assigned in all cases, but the other parameters depend on the state.
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.
Returns a reference to this script instance.
Vector3 GetSpawnPosition |
( |
int |
teamIndex | ) |
|
Returns a random spawn position within the team's spawn area.
Returns the next team index a player should be assigned to.
Returns whether a team reached the maximum game score.
Global check whether this client is the match master or not.
void OnCollectibleStateChanged |
( |
SyncListStruct< CollectibleState >.Operation |
op, |
|
|
int |
index |
|
) |
| |
Method called by the SyncList operation over the Network when its content changes. This is an implementation for changes to the buffered Collectibles, updating their position and assignment. Parameters: type of operation, index of Collectible which received updates.
override void OnStartClient |
( |
| ) |
|
On establishing a successful connection to the master and initializing client variables, update the game UI, i.e. team fill and scores, by looping over the received SyncLists.
override void OnStartServer |
( |
| ) |
|
Server only: initialize SyncList length with team size once. Also verifies the team fill for each team in case of host migration.
bool friendlyFire = false |
Enable or disable friendly fire. This is verified in the Bullet script on collision.
Active game mode played in the current scene.
The local player instance spawned for this client.
The maximum amount of kills to reach before ending the game.
The delay in seconds before respawning a player after it got killed.
SyncListInt score = new SyncListInt() |
Networked list storing team scores for each team. E.g. if score[0] = 2, team 0 scored 2 points.
SyncListInt size = new SyncListInt() |
Networked list storing team fill for each team. E.g. if size[0] = 2, there are two players in team 0.
Definition of playing teams with additional properties.
Reference to the UI script displaying game stats.
The documentation for this class was generated from the following file: