public static void SetUser(UnityUser user, IUpdateDelegate updater, IProjectProvider client, PlayerStorage storage) // TODO Rename or move into a ProjectLister manager class { // ProjectLister s_ProjectListerSettings = new ProjectListerSettings(); s_ProjectListerSettings.OnProjectsRefreshCompleted = new ProjectListerSettings.ProjectsEvents(); s_ProjectListerSettings.OnProjectsRefreshStarted = new UnityEvent(); s_ProjectListerSettings.OnProjectsRefreshCompleted.AddListener((projects) => { projectsRefreshCompleted?.Invoke(projects); }); s_ProjectLister = new ProjectsLister(s_ProjectListerSettings) { client = client }; s_ProjectLister.SetUpdateDelegate(updater); s_ProjectDeleterSettings = new ProjectDeleterSettings(); s_ProjectDeleterSettings.projectLocalDataDeleted += OnProjectLocalDataDeleted; s_ProjectDeleterSettings.projectDeleteCanceled += OnProjectDeleteCanceled; s_ProjectDeleterSettings.projectDeleteProgressChanged += OnProjectDeleteProgressChanged; s_ProjectDeleter = new ProjectDeleter(s_ProjectDeleterSettings, storage) { client = client }; s_ProjectDeleter.SetUpdateDelegate(updater); s_ProjectDownloaderSettings = new ProjectDownloaderSettings(); s_ProjectDownloaderSettings.projectDataDownloaded += OnProjectDataDownloaded; s_ProjectDownloaderSettings.projectDownloadCanceled += OnProjectDownloadCanceled; s_ProjectDownloaderSettings.projectDownloadProgressChanged += OnProjectDownloadProgressChanged; s_ProjectDownloader = new ProjectDownloader(s_ProjectDownloaderSettings, updater, user, storage); }
public static void ClearUser() { s_ProjectLister?.Dispose(); s_ProjectLister = null; s_ProjectListerSettings = null; s_ProjectDeleter?.Dispose(); s_ProjectDeleter = null; s_ProjectDeleterSettings = null; s_ProjectDownloader?.Dispose(); s_ProjectDownloader = null; s_ProjectDownloaderSettings = null; }