docs.unity3d.com
    Show / Hide Table of Contents

    Class InitializationOptions

    Contain all options to customize services initialization when calling InitializeAsync(InitializationOptions).

    Inheritance
    Object
    InitializationOptions
    Namespace: Unity.Services.Core
    Syntax
    public class InitializationOptions

    Constructors

    InitializationOptions()

    Create a new instance of the InitializationOptions class.

    Declaration
    public InitializationOptions()

    Methods

    SetOption(String, Boolean)

    Stores the given value for the given key.

    Declaration
    public InitializationOptions SetOption(string key, bool value)
    Parameters
    Type Name Description
    String key

    The identifier of the configuration entry.

    Boolean value

    The value to store.

    Returns
    Type Description
    InitializationOptions

    Return this instance.

    SetOption(String, Int32)

    Stores the given value for the given key.

    Declaration
    public InitializationOptions SetOption(string key, int value)
    Parameters
    Type Name Description
    String key

    The identifier of the configuration entry.

    Int32 value

    The value to store.

    Returns
    Type Description
    InitializationOptions

    Return this instance.

    SetOption(String, Single)

    Stores the given value for the given key.

    Declaration
    public InitializationOptions SetOption(string key, float value)
    Parameters
    Type Name Description
    String key

    The identifier of the configuration entry.

    Single value

    The value to store.

    Returns
    Type Description
    InitializationOptions

    Return this instance.

    SetOption(String, String)

    Stores the given value for the given key.

    Declaration
    public InitializationOptions SetOption(string key, string value)
    Parameters
    Type Name Description
    String key

    The identifier of the configuration entry.

    String value

    The value to store.

    Returns
    Type Description
    InitializationOptions

    Return this instance.

    TryGetOption(String, out Boolean)

    Get the option for the given key if any.

    Declaration
    public bool TryGetOption(string key, out bool option)
    Parameters
    Type Name Description
    String key

    The key of the option to retrieve.

    Boolean option

    The stored option if any.

    Returns
    Type Description
    Boolean

    Return true if there is a bool for the given key; return false otherwise.

    TryGetOption(String, out Int32)

    Get the option for the given key if any.

    Declaration
    public bool TryGetOption(string key, out int option)
    Parameters
    Type Name Description
    String key

    The key of the option to retrieve.

    Int32 option

    The stored option if any.

    Returns
    Type Description
    Boolean

    Return true if there is a int for the given key; return false otherwise.

    TryGetOption(String, out Single)

    Get the option for the given key if any.

    Declaration
    public bool TryGetOption(string key, out float option)
    Parameters
    Type Name Description
    String key

    The key of the option to retrieve.

    Single option

    The stored option if any.

    Returns
    Type Description
    Boolean

    Return true if there is a float for the given key; return false otherwise.

    TryGetOption(String, out String)

    Get the option for the given key if any.

    Declaration
    public bool TryGetOption(string key, out string option)
    Parameters
    Type Name Description
    String key

    The key of the option to retrieve.

    String option

    The stored option if any.

    Returns
    Type Description
    Boolean

    Return true if there is a string for the given key; return false otherwise.

    Extension Methods

    AnalyticsOptionsExtensions.SetAnalyticsUserId(InitializationOptions, String)
    EnvironmentsOptionsExtensions.SetEnvironmentName(InitializationOptions, String)
    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