Photon Quantum 3.0.0

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

The script will can manage multiple online clients and Quantum players in your Editor. This means the remote view of your player can be visualized in the same Unity instance. Minimum settings: More...

Inheritance diagram for Quantum.QuantumMultiClientRunner:
Quantum.QuantumMonoBehaviour

Public Member Functions

async void CreateNewClient ()
 Create a new client. More...
 
void OnDisable ()
 Unity OnDisabled method. Removes subscriptions from GUI buttons. Quantum subscriptions are automatically removed. More...
 
void OnEnable ()
 Unity OnEnabled method, subscribes to relevant Quantum callbacks. More...
 
async void Start ()
 Unity Start method. Toggles game objects and create initial clients. More...
 

Public Attributes

UnityEngine.UI.Button CreatePlayerBtn
 The button to create a new client connection. More...
 
List< GameObject > DisableOnStart = new List<GameObject>()
 Quantum scripts in your game scene that are part of the regular setup like QuantumEntityViewUpdater, Input and CustomCallbacks need to be disabled when using the MultiClientRunner, add them here. More...
 
QuantumEntityViewUpdater EntityViewUpdaterTemplate
 Optionally provide a custom QuantumEntityViewUpdater game object template that is instantiated for the clients (otherwise a new instance of QuantumEntityViewUpdater is created for each player). More...
 
QuantumGameGizmosSettingsScriptableObject GizmosSettings
 Optionally provide non-default editor settings for all additional clients after the first one (to change the gizmo colors for example). More...
 
int InitialClientCount = 0
 How many clients to start with when starting the app. More...
 
int InitialPlayerCount = 0
 How many additional players per client to start with when starting the app. More...
 
float InitialPlayerDelayInSec = 0.0f
 Start initial clients and players with an extra delay. More...
 
int PlayerCount = 4
 Set the max player count More...
 
GameObject PlayerInputTemplate
 Provide a player input template that is instantiated for the clients. A Unity script that has to implement void Unity message PollInput(CallbackPollInput c). More...
 
QuantumMultiClientPlayerView PlayerViewTemplate
 Get instantiated for each client and makes connection controls for that client available. More...
 
RuntimeConfig RuntimeConfig
 Add custom runtime config settings here More...
 
RuntimePlayer[] RuntimePlayer
 Add custom runtime player settings here. More...
 
PhotonServerSettings ServerSettings
 Optionally provide different non-default server app settings. More...
 
QuantumDeterministicSessionConfigAsset SessionConfig
 Add a session config here. More...
 
bool UsePrivateAppVersion = true
 Use a private AppVersion when connecting to isolate matchmaking players More...
 
bool UseRandomMatchmaking = false
 Use random matchmaking or let subsequent players join the primary players room. More...
 

Detailed Description

The script will can manage multiple online clients and Quantum players in your Editor. This means the remote view of your player can be visualized in the same Unity instance. Minimum settings:

public class QuantumMultiClientTestInput : QuantumMonoBehaviour {
private void PollInput(CallbackPollInput c) {
var i = new Quantum.Input();
i.Direction.X = 1;
i.Direction.Y = 0;
c.SetInput(i, DeterministicInputFlags.Repeatable);
}
}

Member Function Documentation

◆ Start()

async void Quantum.QuantumMultiClientRunner.Start ( )
inline

Unity Start method. Toggles game objects and create initial clients.

◆ OnEnable()

void Quantum.QuantumMultiClientRunner.OnEnable ( )
inline

Unity OnEnabled method, subscribes to relevant Quantum callbacks.

◆ OnDisable()

void Quantum.QuantumMultiClientRunner.OnDisable ( )
inline

Unity OnDisabled method. Removes subscriptions from GUI buttons. Quantum subscriptions are automatically removed.

◆ CreateNewClient()

async void Quantum.QuantumMultiClientRunner.CreateNewClient ( )
inline

Create a new client.

Member Data Documentation

◆ PlayerViewTemplate

QuantumMultiClientPlayerView Quantum.QuantumMultiClientRunner.PlayerViewTemplate

Get instantiated for each client and makes connection controls for that client available.

◆ CreatePlayerBtn

UnityEngine.UI.Button Quantum.QuantumMultiClientRunner.CreatePlayerBtn

The button to create a new client connection.

◆ DisableOnStart

List<GameObject> Quantum.QuantumMultiClientRunner.DisableOnStart = new List<GameObject>()

Quantum scripts in your game scene that are part of the regular setup like QuantumEntityViewUpdater, Input and CustomCallbacks need to be disabled when using the MultiClientRunner, add them here.

◆ GizmosSettings

QuantumGameGizmosSettingsScriptableObject Quantum.QuantumMultiClientRunner.GizmosSettings

Optionally provide non-default editor settings for all additional clients after the first one (to change the gizmo colors for example).

◆ ServerSettings

PhotonServerSettings Quantum.QuantumMultiClientRunner.ServerSettings

Optionally provide different non-default server app settings.

◆ SessionConfig

QuantumDeterministicSessionConfigAsset Quantum.QuantumMultiClientRunner.SessionConfig

Add a session config here.

◆ RuntimeConfig

RuntimeConfig Quantum.QuantumMultiClientRunner.RuntimeConfig

Add custom runtime config settings here

◆ PlayerCount

int Quantum.QuantumMultiClientRunner.PlayerCount = 4

Set the max player count

◆ InitialClientCount

int Quantum.QuantumMultiClientRunner.InitialClientCount = 0

How many clients to start with when starting the app.

◆ InitialPlayerCount

int Quantum.QuantumMultiClientRunner.InitialPlayerCount = 0

How many additional players per client to start with when starting the app.

◆ InitialPlayerDelayInSec

float Quantum.QuantumMultiClientRunner.InitialPlayerDelayInSec = 0.0f

Start initial clients and players with an extra delay.

◆ RuntimePlayer

RuntimePlayer [] Quantum.QuantumMultiClientRunner.RuntimePlayer

Add custom runtime player settings here.

◆ PlayerInputTemplate

GameObject Quantum.QuantumMultiClientRunner.PlayerInputTemplate

Provide a player input template that is instantiated for the clients. A Unity script that has to implement void Unity message PollInput(CallbackPollInput c).

◆ EntityViewUpdaterTemplate

QuantumEntityViewUpdater Quantum.QuantumMultiClientRunner.EntityViewUpdaterTemplate

Optionally provide a custom QuantumEntityViewUpdater game object template that is instantiated for the clients (otherwise a new instance of QuantumEntityViewUpdater is created for each player).

◆ UseRandomMatchmaking

bool Quantum.QuantumMultiClientRunner.UseRandomMatchmaking = false

Use random matchmaking or let subsequent players join the primary players room.

◆ UsePrivateAppVersion

bool Quantum.QuantumMultiClientRunner.UsePrivateAppVersion = true

Use a private AppVersion when connecting to isolate matchmaking players

Quantum
Definition: PlayerRef.cs:6
Quantum.Input
Definition: CodeGenStub.cs:21
Quantum.CallbackId.PollInput
@ PollInput
Callback called when the simulation queries local input.
Photon.Deterministic.DeterministicInputFlags
DeterministicInputFlags
The DeterministicInputFlags are used by Quantum to:
Definition: DeterministicTickInput.cs:20