Class PlayerDataObject
Custom data property for a player.
Inherited Members
Namespace: Unity.Services.Lobbies.Models
Assembly: Unity.Services.Multiplayer.dll
Syntax
[Preserve]
[DataContract(Name = "PlayerDataObject")]
public class PlayerDataObject
Constructors
PlayerDataObject(VisibilityOptions, string)
Custom data property for a player.
Declaration
[Preserve]
public PlayerDataObject(PlayerDataObject.VisibilityOptions visibility, string value = null)
Parameters
Type | Name | Description |
---|---|---|
PlayerDataObject.VisibilityOptions | visibility | Indicates for whom the property should be visible. If |
string | value | The value of the custom property. This property can be set to null or an empty string. |
Properties
Value
The value of the custom property. This property can be set to null or an empty string.
Declaration
[Preserve]
[DataMember(Name = "value", EmitDefaultValue = false)]
public string Value { get; set; }
Property Value
Type | Description |
---|---|
string |
Visibility
Indicates for whom the property should be visible. If public
, the property will be visible to everyone and will be included in query results. If member
, the data will only be visible to users who are members of the lobby (i.e. those who have successfully joined). If private
, the metadata will only be visible to the player.
Declaration
[Preserve]
[JsonConverter(typeof(StringEnumConverter))]
[DataMember(Name = "visibility", IsRequired = true, EmitDefaultValue = true)]
public PlayerDataObject.VisibilityOptions Visibility { get; }
Property Value
Type | Description |
---|---|
PlayerDataObject.VisibilityOptions |