/// <summary> /// Called when any loading error occurs. /// </summary> /// <param name="contextualizedError">Thrown error containing an attached context.</param> private static void OnError(IContextualizedError contextualizedError) { var assetLoaderContext = contextualizedError?.GetContext() as AssetLoaderContext; var zipLoadCustomContextData = assetLoaderContext?.CustomData as ZipLoadCustomContextData; zipLoadCustomContextData?.Stream.Close(); zipLoadCustomContextData?.OnError?.Invoke(contextualizedError); }
/// <summary>Event triggered when there is any Model loading error.</summary> /// <param name="contextualizedError">The Contextualized Error that has occurred.</param> protected override void OnError(IContextualizedError contextualizedError) { var context = contextualizedError.GetContext(); if (context is AssetLoaderContext assetLoaderContext) { var zipLoadCustomContextData = (ZipLoadCustomContextData)assetLoaderContext.CustomData; var uriLoadCustomContextData = (UriLoadCustomContextData)zipLoadCustomContextData.CustomData; var downloaded = Instantiate(_downloadTemplate, _downloadTemplate.transform.parent); var text = downloaded.GetComponentInChildren <Text>(); text.text = $"Error: {uriLoadCustomContextData.UnityWebRequest.uri.Segments[uriLoadCustomContextData.UnityWebRequest.uri.Segments.Length - 1]}"; downloaded.SetActive(true); } base.OnError(contextualizedError); }
/// <summary> /// Called when any error occurs. /// </summary> /// <param name="obj">The contextualized error, containing the original exception and the context passed to the method where the error was thrown.</param> private void OnError(IContextualizedError obj) { Debug.LogError($"An error ocurred while loading your Model: {obj.GetInnerException()}"); }
/// <summary>Event that is triggered when any error occurs.</summary> /// <param name="contextualizedError">The Contextualized Error that has occurred.</param> protected virtual void OnError(IContextualizedError contextualizedError) { Debug.LogError(contextualizedError); RootGameObject = null; SetLoading(false); }
// This event is called when there is any critical error loading your model. // You can use this to show a message to the user. private void OnError(IContextualizedError contextualizedError) { Debug.LogError("TriLib Error: " + contextualizedError); }
/// <summary> /// Event is triggered when any error occurs. /// </summary> /// <param name="contextualizedError">The Contextualized Error that has occurred.</param> protected override void OnError(IContextualizedError contextualizedError) { base.OnError(contextualizedError); StopAnimation(); _stopwatch?.Stop(); }
void OnError(IContextualizedError obj) { Debug.LogError(obj.GetInnerException()); loadObj = null; OnLoadFinish(); }
/// <summary> /// For meshes... /// </summary> /// <param name="obj"></param> private void OnModelLoadError(IContextualizedError obj) { Notifications.Instance.ShowNotification("Unable to show mesh " + this.GetName(), obj.GetInnerException().Message); }
/// <summary> /// Event triggered when any model loading error occurs. /// </summary> /// <param name="contextualizedError">The error containing the related context.</param> private void OnError(IContextualizedError contextualizedError) { Debug.LogError($"There was an error loading your model: {contextualizedError}"); }