docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class UnityServices

    Utility to initialize all Unity services from a single endpoint.

    Inheritance
    object
    UnityServices
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: Unity.Services.Core
    Assembly: Unity.Services.Core.dll
    Syntax
    public static class UnityServices

    Properties

    ExternalUserId

    ExternalUserId. Use this property to pass a user ID from a 3rd party identity provider to Unity Gaming Services

    Declaration
    public static string ExternalUserId { get; set; }
    Property Value
    Type Description
    string

    Instance

    The main runtime instance of unity services.

    Declaration
    public static IUnityServices Instance { get; set; }
    Property Value
    Type Description
    IUnityServices

    State

    Initialization state.

    Declaration
    public static ServicesInitializationState State { get; }
    Property Value
    Type Description
    ServicesInitializationState

    Methods

    CreateServices()

    Create a new services registry.

    Declaration
    public static IUnityServices CreateServices()
    Returns
    Type Description
    IUnityServices

    The services registry instance

    InitializeAsync()

    Single entry point to initialize all used services.

    Declaration
    public static Task InitializeAsync()
    Returns
    Type Description
    Task

    Return a handle to the initialization operation.

    Exceptions
    Type Condition
    ServicesInitializationException

    Exception when there's an error during services initialization

    UnityProjectNotLinkedException

    Exception when the project is not linked to a cloud project id

    InitializeAsync(InitializationOptions)

    Single entry point to initialize all used services.

    Declaration
    public static Task InitializeAsync(InitializationOptions options)
    Parameters
    Type Name Description
    InitializationOptions options

    The options to customize services initialization.

    Returns
    Type Description
    Task

    Return a handle to the initialization operation.

    Exceptions
    Type Condition
    ServicesInitializationException

    Exception when there's an error during services initialization

    UnityProjectNotLinkedException

    Exception when the project is not linked to a cloud project id

    Events

    InitializeFailed

    Invoked when initialization fails.

    Declaration
    public static event Action<Exception> InitializeFailed
    Event Type
    Type Description
    Action<Exception>

    Initialized

    Invoked when initialization completes successfully.

    Declaration
    public static event Action Initialized
    Event Type
    Type Description
    Action
    In This Article
    Back to top
    Copyright © 2024 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)