Noble Connect
Add relays and punchthrough to Mirror or UNet
NobleConnect.Mirror.NobleRoomPlayer Class Reference

This component works in conjunction with the NetworkRoomManager to make up the multiplayer room system. More...

Inherits NetworkBehaviour.

Public Member Functions

void Start ()
 Do not use Start - Override OnStartrHost / OnStartClient instead! More...
 
void CmdChangeReadyState (bool readyState)
 
virtual void OnClientEnterRoom ()
 This is a hook that is invoked on all player objects when entering the room. More...
 
virtual void OnClientExitRoom ()
 This is a hook that is invoked on all player objects when exiting the room. More...
 
virtual void OnClientReady (bool readyState)
 This is a hook that is invoked on clients when a RoomPlayer switches between ready or not ready. More...
 
virtual void OnGUI ()
 Render a UI for the room. Override to provide your on UI More...
 

Public Attributes

bool showRoomGUI = true
 This flag controls whether the default UI is shown for the room player. More...
 
bool readyToBegin
 Diagnostic flag indicating whether this player is ready for the game to begin. More...
 
int index
 Diagnostic index of the player, e.g. Player1, Player2, etc. More...
 

Detailed Description

This component works in conjunction with the NetworkRoomManager to make up the multiplayer room system.

The RoomPrefab object of the NetworkRoomManager must have this component on it. This component holds basic room player data required for the room to function. Game specific data for room players can be put in other components on the RoomPrefab or in scripts derived from NetworkRoomPlayer.

Member Function Documentation

◆ CmdChangeReadyState()

void NobleConnect.Mirror.NobleRoomPlayer.CmdChangeReadyState ( bool  readyState)

◆ OnClientEnterRoom()

virtual void NobleConnect.Mirror.NobleRoomPlayer.OnClientEnterRoom ( )
virtual

This is a hook that is invoked on all player objects when entering the room.

Note: isLocalPlayer is not guaranteed to be set until OnStartLocalPlayer is called.

◆ OnClientExitRoom()

virtual void NobleConnect.Mirror.NobleRoomPlayer.OnClientExitRoom ( )
virtual

This is a hook that is invoked on all player objects when exiting the room.

◆ OnClientReady()

virtual void NobleConnect.Mirror.NobleRoomPlayer.OnClientReady ( bool  readyState)
virtual

This is a hook that is invoked on clients when a RoomPlayer switches between ready or not ready.

This function is called when the a client player calls CmdChangeReadyState.

Parameters
readyStateWhether the player is ready or not.

◆ OnGUI()

virtual void NobleConnect.Mirror.NobleRoomPlayer.OnGUI ( )
virtual

Render a UI for the room. Override to provide your on UI

◆ Start()

void NobleConnect.Mirror.NobleRoomPlayer.Start ( )

Do not use Start - Override OnStartrHost / OnStartClient instead!

Member Data Documentation

◆ index

int NobleConnect.Mirror.NobleRoomPlayer.index

Diagnostic index of the player, e.g. Player1, Player2, etc.

◆ readyToBegin

bool NobleConnect.Mirror.NobleRoomPlayer.readyToBegin

Diagnostic flag indicating whether this player is ready for the game to begin.

Invoke CmdChangeReadyState method on the client to set this flag.

When all players are ready to begin, the game will start. This should not be set directly, CmdChangeReadyState should be called on the client to set it on the server.

◆ showRoomGUI

bool NobleConnect.Mirror.NobleRoomPlayer.showRoomGUI = true

This flag controls whether the default UI is shown for the room player.

As this UI is rendered using the old GUI system, it is only recommended for testing purposes.