Change Dialog on Load Error


A sample for overwriting a callback when there is a file load error.

using UnityEngine;
using Utage;
using System.Collections;


/// <summary>
/// Sample LoadErrorのコールバック関数を書き換え
/// </summary>
[AddComponentMenu("Utage/ADV/Examples/SampleLoadError")]
public class SampleLoadError : MonoBehaviour
{
    void Awake()
    {
        AssetFileManager.SetLoadErrorCallBack(CustomCallbackFileLoadError);
    }

    void CustomCallbackFileLoadError(AssetFile file)
    {
        string errorMsg = "インターネットに接続した状況でプレイしてください";
        if (SystemUi.GetInstance() != null)
        {
            //リロードを促すダイアログを表示
            SystemUi.GetInstance().OpenDialog1Button(
                errorMsg, LanguageSystemText.LocalizeText(SystemText.Retry),
                ()=>OnRetry(file));
            this.gameObject.SetActive(false);
        }
        else
        {
            OnRetry(file);
        }
    }

    void OnRetry(AssetFile file)
    {
        AssetFileManager.ReloadFile(file);
    }
}

The dialog box displayed when there is a load error contains information such as the address of the file that it was attempting to load. Hence, there may be many situations where you will want to display a different message.
In this case, you can change the dialog box to be displayed as shown above.