ロードエラー時のダイアログを変える
投稿日:2015年10月21日 | 最終更新日:2015年12月3日
ファイルロードエラー時のコールバックを書き換えるサンプルです
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); } }
ロードエラー時に表示されるダイアログは、ロード先のアドレスなどが書いてあるため、別のメッセージを表示したい場合も多いと思います。
その場合は、上記のようにして表示するダイアログを変えてください。