Class EditorMultiplayerRolesManager
Provides an api for managing multiplayer roles in the editor.
Inherited Members
Namespace: Unity.Multiplayer.Editor
Assembly: Unity.DedicatedServer.MultiplayerRoles.Editor.dll
Syntax
public static class EditorMultiplayerRolesManager
Properties
ActiveMultiplayerRoleMask
Gets or sets the active multiplayer role mask.
Declaration
public static MultiplayerRoleFlags ActiveMultiplayerRoleMask { get; set; }
Property Value
Type | Description |
---|---|
Multiplayer |
EnableMultiplayerRoles
Enables multiplayer roles for the project.
Declaration
public static bool EnableMultiplayerRoles { get; set; }
Property Value
Type | Description |
---|---|
bool |
EnableSafetyChecks
Enables safety checks for multiplayer roles. When entering play mode or building scenes, the editor will check and warn about any stripped GameObject or Component that is referenced by other objects and that can potentially cause null reference errors.
Declaration
public static bool EnableSafetyChecks { get; set; }
Property Value
Type | Description |
---|---|
bool |
Remarks
Disabling this option could improve the performance of entering play mode or building scenes.
Methods
GetMultiplayerRoleForBuildProfile(BuildProfile)
Gets the multiplayer role that is going to be used for the provided build profile.
Declaration
public static MultiplayerRoleFlags GetMultiplayerRoleForBuildProfile(BuildProfile profile)
Parameters
Type | Name | Description |
---|---|---|
Build |
profile | The build profile to get the multiplayer role maks for. |
Returns
Type | Description |
---|---|
Multiplayer |
Returns the multiplayer role mask for the provided build profile. |
GetMultiplayerRoleForBuildTarget(NamedBuildTarget)
Gets the multiplayer role mask that is going to be used for the provided build target.
Declaration
[Obsolete("Use GetMultiplayerRoleForBuildProfile or GetMultiplayerRoleForClassicTarget instead.", false)]
public static MultiplayerRoleFlags GetMultiplayerRoleForBuildTarget(NamedBuildTarget namedBuildTarget)
Parameters
Type | Name | Description |
---|---|---|
Named |
namedBuildTarget | The build target to get the multiplayer role mask for. |
Returns
Type | Description |
---|---|
Multiplayer |
Returns the multiplayer role mask for the provided build target. |
Remarks
For compatibility with build profiles use GetMultiplayerRoleForBuildProfile instead.
GetMultiplayerRoleForClassicTarget(BuildTarget)
Gets the multiplayer role that is going to be used for the provided build target.
Declaration
public static MultiplayerRoleFlags GetMultiplayerRoleForClassicTarget(BuildTarget buildTarget)
Parameters
Type | Name | Description |
---|---|---|
Build |
buildTarget | The build target to get the multiplayer role mask for. |
Returns
Type | Description |
---|---|
Multiplayer |
Returns the multiplayer role mask for the provided build target. |
GetMultiplayerRoleForClassicTarget(BuildTarget, StandaloneBuildSubtarget)
Gets the multiplayer role that is going to be used for the provided build target and subtarget.
Declaration
public static MultiplayerRoleFlags GetMultiplayerRoleForClassicTarget(BuildTarget buildTarget, StandaloneBuildSubtarget subtarget)
Parameters
Type | Name | Description |
---|---|---|
Build |
buildTarget | The build target to get the multiplayer role mask for. |
Standalone |
subtarget | The subtarget to get the multiplayer role mask for. |
Returns
Type | Description |
---|---|
Multiplayer |
Returns the multiplayer role mask for the provided build target and subtarget. |
GetMultiplayerRoleMaskForComponent(Component)
Gets the multiplayer role mask for a Component.
Declaration
public static MultiplayerRoleFlags GetMultiplayerRoleMaskForComponent(Component component)
Parameters
Type | Name | Description |
---|---|---|
Component | component | The Component. |
Returns
Type | Description |
---|---|
Multiplayer |
Returns the multiplayer role mask for the provided Component. |
GetMultiplayerRoleMaskForGameObject(GameObject)
Gets the multiplayer role mask for a GameObject.
Declaration
public static MultiplayerRoleFlags GetMultiplayerRoleMaskForGameObject(GameObject gameObject)
Parameters
Type | Name | Description |
---|---|---|
Game |
gameObject | The GameObject. |
Returns
Type | Description |
---|---|
Multiplayer |
Returns the multiplayer role mask for the provided GameObject. |
SetMultiplayerRoleForBuildProfile(BuildProfile, MultiplayerRoleFlags)
Sets the multiplayer role mask that is going to be used for the provided build profile.
Declaration
public static void SetMultiplayerRoleForBuildProfile(BuildProfile profile, MultiplayerRoleFlags mask)
Parameters
Type | Name | Description |
---|---|---|
Build |
profile | The build profile to set the multiplayer role mask for. |
Multiplayer |
mask | The multiplayer role mask to assing to the build profile. |
SetMultiplayerRoleForBuildTarget(NamedBuildTarget, MultiplayerRoleFlags)
Sets the multiplayer role mask that is going to be used for the provided build target.
Declaration
[Obsolete("Use SetMultiplayerRoleForBuildProfile or SetMultiplayerRoleForClassicTarget instead.", false)]
public static void SetMultiplayerRoleForBuildTarget(NamedBuildTarget namedBuildTarget, MultiplayerRoleFlags mask)
Parameters
Type | Name | Description |
---|---|---|
Named |
namedBuildTarget | The build target to set the multiplayer role mask for. |
Multiplayer |
mask | The multiplayer role mask to assing to the build target. |
Remarks
For compatibility with build profiles use SetMultiplayerRoleForBuildProfile instead.
SetMultiplayerRoleForClassicTarget(BuildTarget, MultiplayerRoleFlags)
Sets the multiplayer role that is going to be used for the provided build target.
Declaration
public static void SetMultiplayerRoleForClassicTarget(BuildTarget buildTarget, MultiplayerRoleFlags mask)
Parameters
Type | Name | Description |
---|---|---|
Build |
buildTarget | The build target to set the multiplayer role mask for. |
Multiplayer |
mask | The multiplayer role mask to assing to the build target. |
SetMultiplayerRoleForClassicTarget(BuildTarget, StandaloneBuildSubtarget, MultiplayerRoleFlags)
Sets the multiplayer role that is going to be used for the provided build target and subtarget.
Declaration
public static void SetMultiplayerRoleForClassicTarget(BuildTarget buildTarget, StandaloneBuildSubtarget subtarget, MultiplayerRoleFlags mask)
Parameters
Type | Name | Description |
---|---|---|
Build |
buildTarget | The build target to set the multiplayer role mask for. |
Standalone |
subtarget | The subtarget to set the multiplayer role mask for. |
Multiplayer |
mask | The multiplayer role mask to assing to the build target and subtarget. |
SetMultiplayerRoleMaskForComponent(Component, MultiplayerRoleFlags)
Sets the multiplayer role mask for a Component.
Declaration
public static void SetMultiplayerRoleMaskForComponent(Component component, MultiplayerRoleFlags mask)
Parameters
Type | Name | Description |
---|---|---|
Component | component | The Component to set the multiplayer role mask to. |
Multiplayer |
mask | The multiplayer role mask to assing to the Component. |
SetMultiplayerRoleMaskForGameObject(GameObject, MultiplayerRoleFlags)
Sets the multiplayer role mask for a GameObject.
Declaration
public static void SetMultiplayerRoleMaskForGameObject(GameObject gameObject, MultiplayerRoleFlags mask)
Parameters
Type | Name | Description |
---|---|---|
Game |
gameObject | The GameObject to set the multiplayer role mask to. |
Multiplayer |
mask | The multiplayer role mask to assing to the GameObject. |
Events
ActiveMultiplayerRoleChanged
Event that is invoked when the active multiplayer role mask changes.
Declaration
public static event Action ActiveMultiplayerRoleChanged
Event Type
Type | Description |
---|---|
Action |