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

UI script for all elements, team events and user interactions in the game scene. More...

Inheritance diagram for UIGame:

Public Member Functions

override void OnRoomPropertiesUpdate (ExitGames.Client.Photon.Hashtable propertiesThatChanged)
 This method gets called whenever room properties have been changed on the network. Updating our team size and score UI display during the game. See the official Photon docs for more details. More...
 
void OnTeamSizeChanged (int[] size)
 This is an implementation for changes to the team fill, updating the slider values (updates UI display of team fill). More...
 
void OnTeamScoreChanged (int[] score)
 This is an implementation for changes to the team score, updating the text values (updates UI display of team scores). More...
 
void ToggleControls (bool state)
 Enables or disables visibility of joystick controls. More...
 
void SetDeathText (string playerName, Team team)
 Sets death text showing who killed the player in its team color. Parameters: killer's name, killer's team More...
 
void SetSpawnDelay (float time)
 Set respawn delay value displayed to the absolute time value received. The remaining time value is calculated in a coroutine by GameManager. More...
 
void DisableDeath ()
 Hides any UI components related to player death after respawn. More...
 
void SetGameOverText (Team team)
 Set game end text and display winning team in its team color. More...
 
void ShowGameOver ()
 Displays the game's end screen. Called by GameManager after few seconds delay. Tries to display a video ad, if not shown already. More...
 
void Restart ()
 Returns to the starting scene and immediately requests another game session. In the starting scene we have the loading screen and disconnect handling set up already, so this saves us additional work of doing the same logic twice in the game scene. The restart request is implemented in another gameobject that lives throughout scene changes. More...
 
void Disconnect ()
 Stops receiving further network updates by hard disconnecting, then load starting scene. More...
 
override void OnLeftRoom ()
 Loads the starting scene. Disconnecting already happened when presenting the GameOver screen. More...
 

Public Attributes

UIJoystick[] controls
 Joystick components controlling player movement and actions on mobile devices. More...
 
Slider[] teamSize
 UI sliders displaying team fill for each team using absolute values. More...
 
Text[] teamScore
 UI texts displaying kill scores for each team. More...
 
Text[] killCounter
 UI texts displaying kill scores for this local player. [0] = Kill Count, [1] = Death Count More...
 
GameObject aimIndicator
 Mobile crosshair aiming indicator for local player. More...
 
Text deathText
 UI text for indicating player death and who killed this player. More...
 
Text spawnDelayText
 UI text displaying the time in seconds left until player respawn. More...
 
Text gameOverText
 UI text for indicating game end and which team has won the round. More...
 
GameObject gameOverMenu
 UI window gameobject activated on game end, offering sharing and restart buttons. More...
 

Detailed Description

UI script for all elements, team events and user interactions in the game scene.

Member Function Documentation

void DisableDeath ( )

Hides any UI components related to player death after respawn.

void Disconnect ( )

Stops receiving further network updates by hard disconnecting, then load starting scene.

override void OnLeftRoom ( )

Loads the starting scene. Disconnecting already happened when presenting the GameOver screen.

override void OnRoomPropertiesUpdate ( ExitGames.Client.Photon.Hashtable  propertiesThatChanged)

This method gets called whenever room properties have been changed on the network. Updating our team size and score UI display during the game. See the official Photon docs for more details.

void OnTeamScoreChanged ( int[]  score)

This is an implementation for changes to the team score, updating the text values (updates UI display of team scores).

void OnTeamSizeChanged ( int[]  size)

This is an implementation for changes to the team fill, updating the slider values (updates UI display of team fill).

void Restart ( )

Returns to the starting scene and immediately requests another game session. In the starting scene we have the loading screen and disconnect handling set up already, so this saves us additional work of doing the same logic twice in the game scene. The restart request is implemented in another gameobject that lives throughout scene changes.

void SetDeathText ( string  playerName,
Team  team 
)

Sets death text showing who killed the player in its team color. Parameters: killer's name, killer's team

void SetGameOverText ( Team  team)

Set game end text and display winning team in its team color.

void SetSpawnDelay ( float  time)

Set respawn delay value displayed to the absolute time value received. The remaining time value is calculated in a coroutine by GameManager.

void ShowGameOver ( )

Displays the game's end screen. Called by GameManager after few seconds delay. Tries to display a video ad, if not shown already.

void ToggleControls ( bool  state)

Enables or disables visibility of joystick controls.

Member Data Documentation

GameObject aimIndicator

Mobile crosshair aiming indicator for local player.

UIJoystick [] controls

Joystick components controlling player movement and actions on mobile devices.

Text deathText

UI text for indicating player death and who killed this player.

GameObject gameOverMenu

UI window gameobject activated on game end, offering sharing and restart buttons.

Text gameOverText

UI text for indicating game end and which team has won the round.

Text [] killCounter

UI texts displaying kill scores for this local player. [0] = Kill Count, [1] = Death Count

Text spawnDelayText

UI text displaying the time in seconds left until player respawn.

Text [] teamScore

UI texts displaying kill scores for each team.

Slider [] teamSize

UI sliders displaying team fill for each team using absolute values.


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