Class WidgetConfiguration
The WidgetConfiguration is a ScriptableObject that contains the configuration for a session.
Inherited Members
Namespace: Unity.Multiplayer.Widgets
Assembly: Unity.Multiplayer.Widgets.Core.dll
Syntax
[CreateAssetMenu(fileName = "WidgetConfiguration", menuName = "Multiplayer/Widgets/WidgetConfiguration")]
public class WidgetConfiguration : ScriptableObject
Fields
ConnectionMode
Choose between a local (Listen) or public (Publish) connection.
Declaration
[FormerlySerializedAs("connectionMode")]
[Header("Direct Connection Settings")]
public ConnectionMode ConnectionMode
Field Value
| Type | Description |
|---|---|
| ConnectionMode |
ConnectionType
The type of connection to use when creating or joining a session.
Declaration
[FormerlySerializedAs("connectionType")]
[Header("Multiplayer Services Settings")]
[Header("Connection Settings")]
public ConnectionType ConnectionType
Field Value
| Type | Description |
|---|---|
| ConnectionType |
EnableVoiceChat
A flag to determine if the player should join the voice channel when joining the session.
Declaration
[FormerlySerializedAs("JoinVoiceChannel")]
[Header("Voice Settings")]
[Tooltip("Automatically join a voice channel for a session when joining the session.")]
public bool EnableVoiceChat
Field Value
| Type | Description |
|---|---|
| bool |
ListenIpAddress
Listen for incoming connection at this address.
Declaration
[FormerlySerializedAs("IpAddress")]
[Tooltip("Listen for incoming connection at this address. This is the local IP address that the host should use. To listen on all interfaces Use 0.0.0.0 when using ConnectionMode.Publish. For a Listen connection the default allows for local testing.")]
public string ListenIpAddress
Field Value
| Type | Description |
|---|---|
| string |
MaxPlayers
The maximum number of players that can join the session.
Declaration
[Header("Session Settings")]
public int MaxPlayers
Field Value
| Type | Description |
|---|---|
| int |
Name
The name of the session to create or join.
Declaration
public string Name
Field Value
| Type | Description |
|---|---|
| string |
NetworkHandler
Custom NetworkHandler that is used during Session Creation.
Can be null. If null, the default NetworkHandler from the Multiplayer Service Package is used.
Declaration
[Tooltip("Custom NetworkHandler that is used during Session Creation. Can be null. If null, the default NetworkHandler from the Multiplayer Service Package is used.")]
public CustomWidgetsNetworkHandler NetworkHandler
Field Value
| Type | Description |
|---|---|
| CustomWidgetsNetworkHandler |
Port
The port number defaults to 0 which selects a randomly available port on the machine and uses the chosen value as the publish port. If a non-zero value is used, the port number applies to both listen and publish addresses.
Declaration
[Tooltip("0 selects a randomly available port on the machine and uses the chosen value as the publish port. If a non-zero value is used, the port number applies to both listen and publish addresses.")]
public int Port
Field Value
| Type | Description |
|---|---|
| int |
PublishIpAddress
Address that clients should use when connecting.
Declaration
[Tooltip("Address that clients should use when connecting. This is the external/public IP address that clients should use as the publish IP.")]
public string PublishIpAddress
Field Value
| Type | Description |
|---|---|
| string |