using UnityEditor.Connect;
using UnityEngine.Scripting.APIUpdating;
namespace Unity.Play.Publisher.Editor
{
///
/// Bridge to the internal UnityConnectSession API
///
[MovedFrom("Unity.Connect.Share.Editor.UnityConnectSession")]
public class UnityConnectSession
{
static UnityConnectSession _instance = new UnityConnectSession();
///
/// Instance of UnityConnectSession
///
public static UnityConnectSession instance
{
get => _instance;
}
///
/// Returns the access token for the user, if logged in
///
///
public string GetAccessToken()
{
return UnityConnect.instance.GetAccessToken();
}
///
/// Gets the environment in which the app is run
///
///
public string GetEnvironment()
{
return UnityConnect.instance.GetEnvironment();
}
///
/// Shows the Unity HUB login form
///
public void ShowLogin()
{
UnityConnect.instance.ShowLogin();
}
///
/// NOTE no-op if user is not logged in
///
///
public static void OpenAuthorizedURLInWebBrowser(string url)
{
UnityConnect.instance.OpenAuthorizedURLInWebBrowser(url);
}
}
}