Exemplo n.º 1
0
        /// <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);
        }
Exemplo n.º 2
0
        /// <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()}");
 }
Exemplo n.º 4
0
 /// <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);
 }
Exemplo n.º 5
0
 // 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);
 }
Exemplo n.º 6
0
 /// <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();
 }
Exemplo n.º 7
0
 void OnError(IContextualizedError obj)
 {
     Debug.LogError(obj.GetInnerException());
     loadObj = null;
     OnLoadFinish();
 }
Exemplo n.º 8
0
 /// <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}");
 }