docs.unity3d.com
    Show / Hide Table of Contents

    Class DataObject

    Inheritance
    Object
    DataObject
    Namespace: Unity.Services.Lobbies.Models
    Syntax
    [Preserve]
    public class DataObject

    Constructors

    DataObject(DataObject.VisibilityOptions, String, DataObject.IndexOptions)

    Custom data property for a lobby.

    Declaration
    [Preserve]
    public DataObject(DataObject.VisibilityOptions visibility, string value = null, DataObject.IndexOptions index = (DataObject.IndexOptions)0)
    Parameters
    Type Name Description
    DataObject.VisibilityOptions 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 host.

    String value

    The value of the custom property. This property can be set to null or an empty string. If this property is indexed (by setting the index field) then the length of the value must be less than 128 bytes.

    DataObject.IndexOptions index

    The name of the column to index this property value under, either S# for strings or N# for numeric values. If an index is specified on a property, then you can use that index name in a QueryFilter to filter results by that property. You will not be prevented from indexing multiple objects having properties with different names but the same index, but you will likely receive unexpected results from a query.

    Properties

    Index

    The name of the column to index this property value under, either S# for strings or N# for numeric values. If an index is specified on a property, then you can use that index name in a QueryFilter to filter results by that property. You will not be prevented from indexing multiple objects having properties with different names but the same index, but you will likely receive unexpected results from a query.

    Declaration
    [Preserve]
    public DataObject.IndexOptions Index { get; }
    Property Value
    Type Description
    DataObject.IndexOptions

    Value

    The value of the custom property. This property can be set to null or an empty string. If this property is indexed (by setting the index field) then the length of the value must be less than 128 bytes.

    Declaration
    [Preserve]
    public string Value { get; }
    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 host.

    Declaration
    [Preserve]
    public DataObject.VisibilityOptions Visibility { get; }
    Property Value
    Type Description
    DataObject.VisibilityOptions
    In This Article
    • Constructors
      • DataObject(DataObject.VisibilityOptions, String, DataObject.IndexOptions)
    • Properties
      • Index
      • Value
      • Visibility
    Back to top
    Terms of use
    Copyright © 2023 Unity Technologies — Terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on 18 October 2023