Photon Quantum 3.0.0

Public Member Functions | Public Attributes | Properties | List of all members
Quantum.QuantumMultiClientPlayer Class Reference

This class keeps track of individual Photon connections and Quantum simulations (QuantumRunner). More...

Inheritance diagram for Quantum.QuantumMultiClientPlayer:
Quantum.QuantumMonoBehaviour

Public Member Functions

 QuantumMultiClientPlayer ()
 Constructor. More...
 
void BindView (QuantumMultiClientPlayerView view, bool isFirstPlayer, bool isAddPlayerEnabled)
 Binds a player view to this player. More...
 
void CreateEntityViewUpdater (QuantumEntityViewUpdater entityViewUpdaterTemplate, QuantumGame game)
 Instantiates an entity view updater script from a template. More...
 
int CreateFreeClientPlayerSlot (int maxLocalPlayers)
 Tries to allocate a free player slot for this player. Returns a valid player slot or -1 if no slot is available. More...
 
void CreateInput (GameObject playerInputTemplate)
 Instantiates an input script from a template. More...
 
void Destroy ()
 Unity destroy callback shuts down the player (ui, input and evu). More...
 
int GetHighestSiblingIndex ()
 Gets the highest sibling index of this player and all local players used to correctly name GameObjects. More...
 

Public Attributes

GameObject Input => _input
 The Input object to toggle on or off. More...
 
string RunnerId => Runner?.Id
 Access the runner id of it's runner or null if it does not exist. More...
 
QuantumMultiClientPlayerView View => _ui
 Access the view object. More...
 

Properties

Action< QuantumMultiClientPlayerDestroyPlayerCallback [get, set]
 The callback to notify the MultiClientRunner class of pressing exit. More...
 
List< QuantumMultiClientPlayerLocalPlayers [get, set]
 Other local players running on this players connection and QuantumRunner. More...
 
QuantumMultiClientPlayer MainPlayer [get, set]
 If this player is using the connection and QuantumRunner of another player (only used when AddAsLocalPlayers is enabled). More...
 
int PlayerSlot [get, set]
 The local player slot this player uses. Only used when AddAsLocalPlayers is enabled. More...
 
QuantumRunner Runner [get, set]
 The QuantumRunner that this player belongs to. More...
 
IDisposable ShutdownHandler [get, set]
 The shutdown handler used to keep track of disconnect events from the QuantumRunner. Requires a reference to clean up during destruction. More...
 

Detailed Description

This class keeps track of individual Photon connections and Quantum simulations (QuantumRunner).

Constructor & Destructor Documentation

◆ QuantumMultiClientPlayer()

Quantum.QuantumMultiClientPlayer.QuantumMultiClientPlayer ( )
inline

Constructor.

Member Function Documentation

◆ CreateFreeClientPlayerSlot()

int Quantum.QuantumMultiClientPlayer.CreateFreeClientPlayerSlot ( int  maxLocalPlayers)
inline

Tries to allocate a free player slot for this player. Returns a valid player slot or -1 if no slot is available.

◆ GetHighestSiblingIndex()

int Quantum.QuantumMultiClientPlayer.GetHighestSiblingIndex ( )
inline

Gets the highest sibling index of this player and all local players used to correctly name GameObjects.

Returns

◆ CreateInput()

void Quantum.QuantumMultiClientPlayer.CreateInput ( GameObject  playerInputTemplate)
inline

Instantiates an input script from a template.

◆ CreateEntityViewUpdater()

void Quantum.QuantumMultiClientPlayer.CreateEntityViewUpdater ( QuantumEntityViewUpdater  entityViewUpdaterTemplate,
QuantumGame  game 
)
inline

Instantiates an entity view updater script from a template.

◆ BindView()

void Quantum.QuantumMultiClientPlayer.BindView ( QuantumMultiClientPlayerView  view,
bool  isFirstPlayer,
bool  isAddPlayerEnabled 
)
inline

Binds a player view to this player.

◆ Destroy()

void Quantum.QuantumMultiClientPlayer.Destroy ( )
inline

Unity destroy callback shuts down the player (ui, input and evu).

Member Data Documentation

◆ RunnerId

string Quantum.QuantumMultiClientPlayer.RunnerId => Runner?.Id

Access the runner id of it's runner or null if it does not exist.

◆ Input

GameObject Quantum.QuantumMultiClientPlayer.Input => _input

The Input object to toggle on or off.

◆ View

QuantumMultiClientPlayerView Quantum.QuantumMultiClientPlayer.View => _ui

Access the view object.

Property Documentation

◆ Runner

QuantumRunner Quantum.QuantumMultiClientPlayer.Runner
getset

The QuantumRunner that this player belongs to.

◆ ShutdownHandler

IDisposable Quantum.QuantumMultiClientPlayer.ShutdownHandler
getset

The shutdown handler used to keep track of disconnect events from the QuantumRunner. Requires a reference to clean up during destruction.

◆ DestroyPlayerCallback

Action<QuantumMultiClientPlayer> Quantum.QuantumMultiClientPlayer.DestroyPlayerCallback
getset

The callback to notify the MultiClientRunner class of pressing exit.

◆ PlayerSlot

int Quantum.QuantumMultiClientPlayer.PlayerSlot
getset

The local player slot this player uses. Only used when AddAsLocalPlayers is enabled.

◆ MainPlayer

QuantumMultiClientPlayer Quantum.QuantumMultiClientPlayer.MainPlayer
getset

If this player is using the connection and QuantumRunner of another player (only used when AddAsLocalPlayers is enabled).

◆ LocalPlayers

List<QuantumMultiClientPlayer> Quantum.QuantumMultiClientPlayer.LocalPlayers
getset

Other local players running on this players connection and QuantumRunner.