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

Race manager. Class in charge of the cars instantiation, camera, ranking and UI. Have a look at the Start() method for race initialisation and Update() for game management. More...

Inheritance diagram for MoreMountains.HighroadEngine.RaceManager:

Public Member Functions

delegate List< BaseControllerOnUpdatePlayersListDelegate ()
 
virtual void Awake ()
 We checks proper initialization of the RaceManager object More...
 
virtual void Start ()
 We initialize the race. More...
 
virtual void ManagerStart ()
 Initializes the players and their cars. More...
 
virtual void UpdateNoPlayersCollisions ()
 Updates the no players collisions from the NoCollisions flag in inspector. More...
 
virtual void InitRespawnButton (GameObject vehicle)
 Inits the respawn button. More...
 
virtual void Update ()
 On Update, we sort the player's list and update score More...
 
virtual void ReturnToMenu ()
 Returns to lobby More...
 
virtual IEnumerator StartGameCountdownCoroutine ()
 Starts the game countdown coroutine. More...
 
virtual void UpdateCountdownText (string text)
 Updates the countdown text. More...
 
virtual void EnableControlForPlayers ()
 Enables the control for players locally More...
 
virtual void DisableControlForPlayers ()
 Disables the control for players locally More...
 
virtual void DisableControlForPlayer (BaseController controller)
 Disables the control for a player locally More...
 

Public Attributes

Vector3[] StartPositions
 the list of start positions More...
 
int StartAngleDegree
 
bool BotsFirstInStartingLine = true
 if true, human players will be placed after bots at start More...
 
bool DynamicCameras
 
CameraController[] CameraControllers
 the list of cameras the player can use More...
 
Text StartGameCountdown
 Text object where start countdown is shown. More...
 
RectTransform EndGamePanel
 Panel shown when game has ended. More...
 
Text EndGameRanking
 Text object for players ranking at the end of the game. More...
 
Button BackButton
 Back button to return to lobby screen. More...
 
Button BackToMenuButton
 Back button to return to lobby screen when racing is finished. More...
 
Button CameraChangeButton
 Button to change camera when multiple cameras are available. More...
 
Button RespawnButton
 Button to respawn player's vehicle. More...
 
Text ScoreText1
 Current score ingame. More...
 
Text ScoreText2
 
Text ScoreText3
 
bool ClosedLoopTrack = true
 If false, last checkpoint is the end of the race like a rally. More...
 
bool FirstFinisherEndsRace = true
 If true, race is ended when first player finish. More...
 
int Laps = 3
 Number of laps for victory. More...
 
int StartGameCountDownTime = 3
 Countdown timer before starting the race. More...
 
bool NoCollisions = false
 Are collisions active in network play. More...
 
GameObject[] Checkpoints
 
GameObject AIWaypoints
 Reference to AI Waypoints object. More...
 
GameObject[] TestHumanPlayers
 List of human players vehicle gameobjects. More...
 
GameObject[] TestBotPlayers
 List of bot players vehicle gameobjects. More...
 
UnityAction OnDisableControlForPlayers
 
UnityAction< BaseControllerOnDisableControlForPlayer
 
UnityAction OnEnableControlForPlayers
 
UnityAction< string > OnUpdateCountdownText
 
UnityAction< string > OnShowEndGameScreen
 
OnUpdatePlayersListDelegate OnUpdatePlayersList
 

Protected Member Functions

virtual void InitTestMode ()
 Initializes the test mode players racing More...
 
virtual void InitPlayers ()
 Initializes the players of the race. Instantiation of gameobjects in single / local mode More...
 
virtual void ChangeActiveCameraController (int index)
 Switch current active camera to new index value More...
 
virtual List< BaseControllerUpdatePlayersList ()
 Returns the players list More...
 
virtual void ShowFinalRanking (List< BaseController > playersRank)
 Shows the final ranking and return button More...
 
virtual void ShowEndGameScreen (string text)
 Shows the end game screen with ranking and exit button More...
 
virtual void OnCameraChange ()
 Called when player change current selected camera. Loops throught each available camera More...
 
virtual void OnDrawGizmos ()
 Help with RaceManager in scene view More...
 

Protected Attributes

float _currentGameTime
 The current race elapsed time. Used in the ranking. More...
 
int _currentCamera
 
CameraController[] _cameraControllersAvailable
 Sublist of camera controllers we can currently use. For instance, we remove single player camera in multi local mode. More...
 
IGenericLobbyManager _lobbyManager
 
bool _isPlaying
 
bool _isNetworkMode
 
bool _testMode = false
 
int _finisherBonusScore = 10000
 
int _currentFinisherRank = 1
 

Properties

Dictionary< int, BaseControllerPlayers [getprotected set]
 a dictionary of the vehicle's gameobjects, using the player's number as index More...
 

Detailed Description

Race manager. Class in charge of the cars instantiation, camera, ranking and UI. Have a look at the Start() method for race initialisation and Update() for game management.

Member Function Documentation

◆ Awake()

virtual void MoreMountains.HighroadEngine.RaceManager.Awake ( )
virtual

We checks proper initialization of the RaceManager object

◆ ChangeActiveCameraController()

virtual void MoreMountains.HighroadEngine.RaceManager.ChangeActiveCameraController ( int  index)
protectedvirtual

Switch current active camera to new index value

Parameters
indexIndex.

◆ DisableControlForPlayer()

virtual void MoreMountains.HighroadEngine.RaceManager.DisableControlForPlayer ( BaseController  controller)
virtual

Disables the control for a player locally

◆ DisableControlForPlayers()

virtual void MoreMountains.HighroadEngine.RaceManager.DisableControlForPlayers ( )
virtual

Disables the control for players locally

◆ EnableControlForPlayers()

virtual void MoreMountains.HighroadEngine.RaceManager.EnableControlForPlayers ( )
virtual

Enables the control for players locally

◆ InitPlayers()

virtual void MoreMountains.HighroadEngine.RaceManager.InitPlayers ( )
protectedvirtual

Initializes the players of the race. Instantiation of gameobjects in single / local mode

◆ InitRespawnButton()

virtual void MoreMountains.HighroadEngine.RaceManager.InitRespawnButton ( GameObject  vehicle)
virtual

Inits the respawn button.

Parameters
vehicleVehicle.

◆ InitTestMode()

virtual void MoreMountains.HighroadEngine.RaceManager.InitTestMode ( )
protectedvirtual

Initializes the test mode players racing

◆ ManagerStart()

virtual void MoreMountains.HighroadEngine.RaceManager.ManagerStart ( )
virtual

Initializes the players and their cars.

◆ OnCameraChange()

virtual void MoreMountains.HighroadEngine.RaceManager.OnCameraChange ( )
protectedvirtual

Called when player change current selected camera. Loops throught each available camera

◆ OnDrawGizmos()

virtual void MoreMountains.HighroadEngine.RaceManager.OnDrawGizmos ( )
protectedvirtual

Help with RaceManager in scene view

◆ OnUpdatePlayersListDelegate()

delegate List< BaseController > MoreMountains.HighroadEngine.RaceManager.OnUpdatePlayersListDelegate ( )

◆ ReturnToMenu()

virtual void MoreMountains.HighroadEngine.RaceManager.ReturnToMenu ( )
virtual

Returns to lobby

◆ ShowEndGameScreen()

virtual void MoreMountains.HighroadEngine.RaceManager.ShowEndGameScreen ( string  text)
protectedvirtual

Shows the end game screen with ranking and exit button

Parameters
textRanking.

◆ ShowFinalRanking()

virtual void MoreMountains.HighroadEngine.RaceManager.ShowFinalRanking ( List< BaseController playersRank)
protectedvirtual

Shows the final ranking and return button

Parameters
playersRankPlayers rank.

◆ Start()

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

We initialize the race.

◆ StartGameCountdownCoroutine()

virtual IEnumerator MoreMountains.HighroadEngine.RaceManager.StartGameCountdownCoroutine ( )
virtual

Starts the game countdown coroutine.

Returns
yield enumerator

◆ Update()

virtual void MoreMountains.HighroadEngine.RaceManager.Update ( )
virtual

On Update, we sort the player's list and update score

◆ UpdateCountdownText()

virtual void MoreMountains.HighroadEngine.RaceManager.UpdateCountdownText ( string  text)
virtual

Updates the countdown text.

Parameters
textText.

◆ UpdateNoPlayersCollisions()

virtual void MoreMountains.HighroadEngine.RaceManager.UpdateNoPlayersCollisions ( )
virtual

Updates the no players collisions from the NoCollisions flag in inspector.

◆ UpdatePlayersList()

virtual List< BaseController > MoreMountains.HighroadEngine.RaceManager.UpdatePlayersList ( )
protectedvirtual

Returns the players list

Returns
The players list.

Member Data Documentation

◆ _cameraControllersAvailable

CameraController [] MoreMountains.HighroadEngine.RaceManager._cameraControllersAvailable
protected

Sublist of camera controllers we can currently use. For instance, we remove single player camera in multi local mode.

◆ _currentCamera

int MoreMountains.HighroadEngine.RaceManager._currentCamera
protected

◆ _currentFinisherRank

int MoreMountains.HighroadEngine.RaceManager._currentFinisherRank = 1
protected

◆ _currentGameTime

float MoreMountains.HighroadEngine.RaceManager._currentGameTime
protected

The current race elapsed time. Used in the ranking.

◆ _finisherBonusScore

int MoreMountains.HighroadEngine.RaceManager._finisherBonusScore = 10000
protected

◆ _isNetworkMode

bool MoreMountains.HighroadEngine.RaceManager._isNetworkMode
protected

◆ _isPlaying

bool MoreMountains.HighroadEngine.RaceManager._isPlaying
protected

◆ _lobbyManager

IGenericLobbyManager MoreMountains.HighroadEngine.RaceManager._lobbyManager
protected

◆ _testMode

bool MoreMountains.HighroadEngine.RaceManager._testMode = false
protected

◆ AIWaypoints

GameObject MoreMountains.HighroadEngine.RaceManager.AIWaypoints

Reference to AI Waypoints object.

◆ BackButton

Button MoreMountains.HighroadEngine.RaceManager.BackButton

Back button to return to lobby screen.

◆ BackToMenuButton

Button MoreMountains.HighroadEngine.RaceManager.BackToMenuButton

Back button to return to lobby screen when racing is finished.

◆ BotsFirstInStartingLine

bool MoreMountains.HighroadEngine.RaceManager.BotsFirstInStartingLine = true

if true, human players will be placed after bots at start

◆ CameraChangeButton

Button MoreMountains.HighroadEngine.RaceManager.CameraChangeButton

Button to change camera when multiple cameras are available.

◆ CameraControllers

CameraController [] MoreMountains.HighroadEngine.RaceManager.CameraControllers

the list of cameras the player can use

◆ Checkpoints

GameObject [] MoreMountains.HighroadEngine.RaceManager.Checkpoints

◆ ClosedLoopTrack

bool MoreMountains.HighroadEngine.RaceManager.ClosedLoopTrack = true

If false, last checkpoint is the end of the race like a rally.

◆ DynamicCameras

bool MoreMountains.HighroadEngine.RaceManager.DynamicCameras

◆ EndGamePanel

RectTransform MoreMountains.HighroadEngine.RaceManager.EndGamePanel

Panel shown when game has ended.

◆ EndGameRanking

Text MoreMountains.HighroadEngine.RaceManager.EndGameRanking

Text object for players ranking at the end of the game.

◆ FirstFinisherEndsRace

bool MoreMountains.HighroadEngine.RaceManager.FirstFinisherEndsRace = true

If true, race is ended when first player finish.

◆ Laps

int MoreMountains.HighroadEngine.RaceManager.Laps = 3

Number of laps for victory.

◆ NoCollisions

bool MoreMountains.HighroadEngine.RaceManager.NoCollisions = false

Are collisions active in network play.

◆ OnDisableControlForPlayer

UnityAction<BaseController> MoreMountains.HighroadEngine.RaceManager.OnDisableControlForPlayer

◆ OnDisableControlForPlayers

UnityAction MoreMountains.HighroadEngine.RaceManager.OnDisableControlForPlayers

◆ OnEnableControlForPlayers

UnityAction MoreMountains.HighroadEngine.RaceManager.OnEnableControlForPlayers

◆ OnShowEndGameScreen

UnityAction<string> MoreMountains.HighroadEngine.RaceManager.OnShowEndGameScreen

◆ OnUpdateCountdownText

UnityAction<string> MoreMountains.HighroadEngine.RaceManager.OnUpdateCountdownText

◆ OnUpdatePlayersList

OnUpdatePlayersListDelegate MoreMountains.HighroadEngine.RaceManager.OnUpdatePlayersList

◆ RespawnButton

Button MoreMountains.HighroadEngine.RaceManager.RespawnButton

Button to respawn player's vehicle.

◆ ScoreText1

Text MoreMountains.HighroadEngine.RaceManager.ScoreText1

Current score ingame.

◆ ScoreText2

Text MoreMountains.HighroadEngine.RaceManager.ScoreText2

◆ ScoreText3

Text MoreMountains.HighroadEngine.RaceManager.ScoreText3

◆ StartAngleDegree

int MoreMountains.HighroadEngine.RaceManager.StartAngleDegree

◆ StartGameCountdown

Text MoreMountains.HighroadEngine.RaceManager.StartGameCountdown

Text object where start countdown is shown.

◆ StartGameCountDownTime

int MoreMountains.HighroadEngine.RaceManager.StartGameCountDownTime = 3

Countdown timer before starting the race.

◆ StartPositions

Vector3 [] MoreMountains.HighroadEngine.RaceManager.StartPositions

the list of start positions

◆ TestBotPlayers

GameObject [] MoreMountains.HighroadEngine.RaceManager.TestBotPlayers

List of bot players vehicle gameobjects.

◆ TestHumanPlayers

GameObject [] MoreMountains.HighroadEngine.RaceManager.TestHumanPlayers

List of human players vehicle gameobjects.

Property Documentation

◆ Players

Dictionary<int, BaseController> MoreMountains.HighroadEngine.RaceManager.Players
getprotected set

a dictionary of the vehicle's gameobjects, using the player's number as index


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