void DownloadCompleted(bool cancelled) { client.Dispose(); client = null; if (cancelled) { try { OnDownloadCancelled?.Invoke(this, EventArgs.Empty); } catch { } return; } setting.SendLog(string.Format("{0}", I18N("DownloadCompleted"))); if (UpdateCore()) { try { OnDownloadCompleted?.Invoke(this, EventArgs.Empty); } catch { } } else { try { OnDownloadFail?.Invoke(this, EventArgs.Empty); } catch { } } }
void NotifyDownloadResults(bool status) { try { if (status) { OnDownloadCompleted?.Invoke(this, EventArgs.Empty); } else { OnDownloadFail?.Invoke(this, EventArgs.Empty); } } catch { } }
private void Awake() { if (INSTANCE == null) { INSTANCE = this; //set the delegates onUploadSuccess += OnUploadCompleted; onDownloadSuccess += OnDownloadCompleted; onUploadFail += OnUploadFailed; onDownloadFail += OnDownloadFailed; //retrieve the highscores at the beginning (this can be done later as well, just seemed handy here) GetHighScores(); } else { UnityEngine.GameObject.Destroy(this); } }