Exemple #1
0
 private static void HandleError(MLMusicService.ErrorType type, int code, IntPtr data)
 {
     MLMusicService.Error error = new MLMusicService.Error {
         Type = type, Code = code
     };
     MLThreadDispatch.Call(error, OnError);
 }
        /// <summary>
        /// Handles an error from the MLMusicService.
        /// </summary>
        /// <param name="error">The error that ocurred.</param>
        private void HandleError(MLMusicService.Error error)
        {
            statusText.text = string.Format("<color=#dbfb76><b>{0}</b></color>\n{1}: {2}\n",
                                            LocalizeManager.GetString("ControllerData"),
                                            LocalizeManager.GetString("Status"),
                                            LocalizeManager.GetString(ControllerStatus.Text));

            MLMusicService.Metadata metaData = musicService.CurrentTrackMetadata;
            statusText.text += string.Format("<color=#dbfb76><b>{0}</b></color>\n{1}: {2} - {3}: {4}, {5}: {6}",
                                             LocalizeManager.GetString("MusicServiceData"),
                                             LocalizeManager.GetString("Status"),
                                             LocalizeManager.GetString("Error"),
                                             LocalizeManager.GetString("Type"),
                                             error.Type,
                                             LocalizeManager.GetString("Code"),
                                             error.Code);

            enabled = false;
            return;
        }
Exemple #3
0
 /// <summary>
 /// Event handler for when an error occurs in the music service
 /// </summary>
 /// <param name="error">Structure defining the error type and any extra error code</param>
 void HandleError(MLMusicService.Error error)
 {
     Debug.LogErrorFormat("MLMusicServiceBehavior failed with an error, type {0}, code {1}", error.Type, error.Code);
     OnError?.Invoke(error);
 }
 private void HandleError(MLMusicService.Error error)
 {
     enabled = false;
 }