Class EditorMultiplayerRolesManager
Provides an api for managing multiplayer roles in the editor.
Inherited Members
Namespace: Unity.Multiplayer.Editor
Assembly: solution.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
GetMultiplayerRoleForBuildTarget(NamedBuildTarget)
Gets the multiplayer role mask that is going to be used for the provided build target.
Declaration
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. |
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. |
SetMultiplayerRoleForBuildTarget(NamedBuildTarget, MultiplayerRoleFlags)
Sets the multiplayer role mask that is going to be used for the provided build target.
Declaration
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. |
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 |