/// <summary> /// 创建加载全局配置失败事件。 /// </summary> /// <param name="configAssetName">全局配置资源名称。</param> /// <param name="errorMessage">错误信息。</param> /// <param name="userData">用户自定义数据。</param> /// <returns>创建的加载全局配置失败事件。</returns> public static LoadConfigFailureEventArgs Create(string configAssetName, string errorMessage, object userData) { LoadConfigFailureEventArgs loadConfigFailureEventArgs = ReferencePool.Acquire <LoadConfigFailureEventArgs>(); loadConfigFailureEventArgs.ConfigAssetName = configAssetName; loadConfigFailureEventArgs.ErrorMessage = errorMessage; loadConfigFailureEventArgs.UserData = userData; return(loadConfigFailureEventArgs); }
void OnLoadConfigFailure(object sender, GameEventArgs e) { LoadConfigFailureEventArgs ne = (LoadConfigFailureEventArgs)e; if (ne.UserData != this) { return; } Log.Error("Can not load config '{0}' from '{1}' with error message '{2}'.", ne.ConfigAssetName, ne.ConfigAssetName, ne.ErrorMessage); }
//加载配置失败的回调 private void OnLoadConfigFailure(object sender, BaseEventArgs e) { LoadConfigFailureEventArgs args = e as LoadConfigFailureEventArgs; if (args.UserData != this) { return; } Log.Error("Can not load config '{0}' from '{1}' with error message '{2}'.", args.ConfigName, args.ConfigAssetName, args.ErrorMessage); }
private void OnLoadConfigFail(object sender, GameEventArgs e) { LoadConfigFailureEventArgs args = (LoadConfigFailureEventArgs)e; if (args.UserData != this) { return; } //if (args.ConfigName.Equals("DefaultConfig")) Debug.Log("DefaultConfig Load Fail"); Log.Error("Can not load config '{0}' from '{1}' with error message '{2}'.", args.ConfigName, args.ConfigAssetName, args.ErrorMessage); }