33 lines
994 B
C#
33 lines
994 B
C#
using BeatSaberPlaylistsLib.Types;
|
|
using UnityEngine;
|
|
using IPALogger = IPA.Logging.Logger;
|
|
|
|
namespace Setlist
|
|
{
|
|
/// <summary>
|
|
/// Persists for <see cref="UnityEngine.MonoBehaviour.StartCoroutine"/> (e.g. BeatLeader POST after UI adds a song).
|
|
/// </summary>
|
|
internal sealed class SetlistSyncHost : MonoBehaviour
|
|
{
|
|
internal static SetlistSyncHost Instance { get; private set; }
|
|
|
|
internal static void Ensure()
|
|
{
|
|
if (Instance != null)
|
|
{
|
|
return;
|
|
}
|
|
|
|
var go = new GameObject("Setlist.SyncHost");
|
|
UnityEngine.Object.DontDestroyOnLoad(go);
|
|
go.hideFlags = HideFlags.HideAndDontSave;
|
|
Instance = go.AddComponent<SetlistSyncHost>();
|
|
}
|
|
|
|
internal void StartPostOwnedBeatLeaderPlaylist(IPlaylist playlist, IPALogger log)
|
|
{
|
|
StartCoroutine(BeatLeaderPlaylistSync.CoPostOwnedPlaylistToBeatLeader(playlist, log));
|
|
}
|
|
}
|
|
}
|