using System;
using System.Collections.Generic;
using System.Runtime.CompilerServices;
using System.Threading.Tasks;
using UnityEngine;
namespace Unity.Services.Core
{
///
/// Utility to initialize all Unity services from a single endpoint.
///
public static class UnityServices
{
///
/// Invoked when initialization completes successfully.
///
public static event Action Initialized
{
add { if (Instance != null) { Instance.Initialized += value; } }
remove { if (Instance != null) { Instance.Initialized -= value; } }
}
///
/// Invoked when initialization fails.
///
public static event Action InitializeFailed
{
add { if (Instance != null) { Instance.InitializeFailed += value; } }
remove { if (Instance != null) { Instance.InitializeFailed -= value; } }
}
///
/// The main runtime instance of unity services.
///
public static IUnityServices Instance { get; set; }
///
/// The custom instances of unity services.
///
public static IReadOnlyDictionary Services => s_Services;
internal static TaskCompletionSource