Highroad Engine v1.3
Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | Properties | List of all members
MoreMountains.HighroadEngine.PunLobbyPlayer Class Reference

This class manages the player state in the lobby. More...

Inheritance diagram for MoreMountains.HighroadEngine.PunLobbyPlayer:
MoreMountains.HighroadEngine.IGenericLobbyPlayer MoreMountains.HighroadEngine.ILobbyPlayerInfo

Public Member Functions

virtual void Start ()
 We use this event to initialize object properties and gui. This is called when a client connects for the first time and when a client goes back to the lobby after a race. More...
 
virtual void OnLeftButton ()
 Describes what happens when pressing the left button More...
 
virtual void OnRightButton ()
 Describes what happens when pressing the right button More...
 
virtual void OnVehicleChange (int direction)
 Changes the current player vehicle More...
 
virtual void OnVehicleChanged (int value)
 Describes what happens when the vehicle changes More...
 
virtual void OnReady ()
 Describes what happens when the player chooses the "READY" action in GUI More...
 
void OnClientReady (bool readyState)
 When player is ready, READY button is disabled. More...
 

Public Attributes

Text PlayerName
 
Button LeftButton
 
Button RightButton
 
Button ReadyButton
 
Text VehicleText
 
Image VehicleImage
 
Sprite ReadyButtonSprite
 
Sprite CancelReadyButtonSprite
 

Protected Member Functions

virtual void OnPlayerNameChanged (string name)
 Updates the player's name in the textbox More...
 
virtual void Update ()
 We need to anchor the GameObject's position otherwise when going back from game to lobby, the object would be moved to an incorrect position. More...
 
virtual void InitUI ()
 Initializes the UI More...
 
virtual void ShowSelectedVehicle ()
 Shows the selected vehicle. More...
 
virtual void UpdateReadyButtonText (bool ready)
 Updates the ready button text. More...
 

Protected Attributes

int _currentTrackSelected
 
string _playerName
 
Vector3 elementPosition = Vector3.zero
 
RectTransform _rectTransform
 
bool readyToBegin = false
 

Properties

int Position [getset]
 
string Name [getset]
 
string VehicleName [getset]
 
int VehicleSelectedIndex [getset]
 
bool IsBot [getset]
 
virtual int TrackSelected [get]
 Gets the currently selected track. More...
 
- Properties inherited from MoreMountains.HighroadEngine.ILobbyPlayerInfo
int Position [getset]
 Position id of the player (starting at 0) More...
 
string Name [getset]
 Name of the player. Generated from player position. More...
 
string VehicleName [getset]
 Player gameobject name used by player. Shown in UI and used to instantiate prefab frome Resources More...
 
int VehicleSelectedIndex [getset]
 Index of the chosen vehicle in UI. More...
 
bool IsBot [getset]
 Boolean indicating if the vehicle is AI controlled More...
 

Detailed Description

This class manages the player state in the lobby.

Member Function Documentation

◆ InitUI()

virtual void MoreMountains.HighroadEngine.PunLobbyPlayer.InitUI ( )
protectedvirtual

Initializes the UI

◆ OnClientReady()

void MoreMountains.HighroadEngine.PunLobbyPlayer.OnClientReady ( bool  readyState)

When player is ready, READY button is disabled.

◆ OnLeftButton()

virtual void MoreMountains.HighroadEngine.PunLobbyPlayer.OnLeftButton ( )
virtual

Describes what happens when pressing the left button

◆ OnPlayerNameChanged()

virtual void MoreMountains.HighroadEngine.PunLobbyPlayer.OnPlayerNameChanged ( string  name)
protectedvirtual

Updates the player's name in the textbox

◆ OnReady()

virtual void MoreMountains.HighroadEngine.PunLobbyPlayer.OnReady ( )
virtual

Describes what happens when the player chooses the "READY" action in GUI

◆ OnRightButton()

virtual void MoreMountains.HighroadEngine.PunLobbyPlayer.OnRightButton ( )
virtual

Describes what happens when pressing the right button

◆ OnVehicleChange()

virtual void MoreMountains.HighroadEngine.PunLobbyPlayer.OnVehicleChange ( int  direction)
virtual

Changes the current player vehicle

Parameters
directionDirection.

◆ OnVehicleChanged()

virtual void MoreMountains.HighroadEngine.PunLobbyPlayer.OnVehicleChanged ( int  value)
virtual

Describes what happens when the vehicle changes

Parameters
valueValue.

◆ ShowSelectedVehicle()

virtual void MoreMountains.HighroadEngine.PunLobbyPlayer.ShowSelectedVehicle ( )
protectedvirtual

Shows the selected vehicle.

◆ Start()

virtual void MoreMountains.HighroadEngine.PunLobbyPlayer.Start ( )
virtual

We use this event to initialize object properties and gui. This is called when a client connects for the first time and when a client goes back to the lobby after a race.

◆ Update()

virtual void MoreMountains.HighroadEngine.PunLobbyPlayer.Update ( )
protectedvirtual

We need to anchor the GameObject's position otherwise when going back from game to lobby, the object would be moved to an incorrect position.

◆ UpdateReadyButtonText()

virtual void MoreMountains.HighroadEngine.PunLobbyPlayer.UpdateReadyButtonText ( bool  ready)
protectedvirtual

Updates the ready button text.

Parameters
readyIf set to true ready.

Member Data Documentation

◆ _currentTrackSelected

int MoreMountains.HighroadEngine.PunLobbyPlayer._currentTrackSelected
protected

◆ _playerName

string MoreMountains.HighroadEngine.PunLobbyPlayer._playerName
protected

◆ _rectTransform

RectTransform MoreMountains.HighroadEngine.PunLobbyPlayer._rectTransform
protected

◆ CancelReadyButtonSprite

Sprite MoreMountains.HighroadEngine.PunLobbyPlayer.CancelReadyButtonSprite

◆ elementPosition

Vector3 MoreMountains.HighroadEngine.PunLobbyPlayer.elementPosition = Vector3.zero
protected

◆ LeftButton

Button MoreMountains.HighroadEngine.PunLobbyPlayer.LeftButton

◆ PlayerName

Text MoreMountains.HighroadEngine.PunLobbyPlayer.PlayerName

◆ ReadyButton

Button MoreMountains.HighroadEngine.PunLobbyPlayer.ReadyButton

◆ ReadyButtonSprite

Sprite MoreMountains.HighroadEngine.PunLobbyPlayer.ReadyButtonSprite

◆ readyToBegin

bool MoreMountains.HighroadEngine.PunLobbyPlayer.readyToBegin = false
protected

◆ RightButton

Button MoreMountains.HighroadEngine.PunLobbyPlayer.RightButton

◆ VehicleImage

Image MoreMountains.HighroadEngine.PunLobbyPlayer.VehicleImage

◆ VehicleText

Text MoreMountains.HighroadEngine.PunLobbyPlayer.VehicleText

Property Documentation

◆ IsBot

bool MoreMountains.HighroadEngine.PunLobbyPlayer.IsBot
getset

◆ Name

string MoreMountains.HighroadEngine.PunLobbyPlayer.Name
getset

◆ Position

int MoreMountains.HighroadEngine.PunLobbyPlayer.Position
getset

◆ TrackSelected

virtual int MoreMountains.HighroadEngine.PunLobbyPlayer.TrackSelected
get

Gets the currently selected track.

The track selected.

◆ VehicleName

string MoreMountains.HighroadEngine.PunLobbyPlayer.VehicleName
getset

◆ VehicleSelectedIndex

int MoreMountains.HighroadEngine.PunLobbyPlayer.VehicleSelectedIndex
getset

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