private void LoadSceneFailureCallback(string sceneAssetName, LoadResourceStatus status, string errorMessage, object userData) { m_LoadingSceneAssetNames.Remove(sceneAssetName); string appendErrorMessage = string.Format("Load scene failure, scene asset name '{0}', status '{1}', error message '{2}'.", sceneAssetName, status.ToString(), errorMessage); if (m_LoadSceneFailureEventHandler != null) { m_LoadSceneFailureEventHandler(this, new LoadSceneFailureEventArgs(sceneAssetName, appendErrorMessage, userData)); return; } throw new GameFrameworkException(appendErrorMessage); }
private void LoadUIFormFailureCallback(string uiFormAssetName, LoadResourceStatus status, string errorMessage, object userData) { OpenUIFormInfo openUIFormInfo = (OpenUIFormInfo)userData; if (openUIFormInfo == null) { throw new System.Exception("Open UI form info is invalid."); } m_UIFormsBeingLoaded.Remove(openUIFormInfo.SerialId); m_UIFormAssetNamesBeingLoaded.Remove(uiFormAssetName); m_UIFormsToReleaseOnLoad.Remove(openUIFormInfo.SerialId); string appendErrorMessage = string.Format("Load UI form failure, asset name '{0}', status '{1}', error message '{2}'.", uiFormAssetName, status.ToString(), errorMessage); if (m_OpenUIFormFailureEventHandler != null) { m_OpenUIFormFailureEventHandler(this, new OpenUIFormFailureEventArgs(openUIFormInfo.SerialId, uiFormAssetName, openUIFormInfo.UIGroup.Name, openUIFormInfo.PauseCoveredUIForm, appendErrorMessage, openUIFormInfo.UserData)); return; } throw new System.Exception(appendErrorMessage); }
private void LoadAssetOrBinaryFailureCallback(string dataAssetName, LoadResourceStatus status, string errorMessage, object userData) { string appendErrorMessage = Utility.Text.Format("Load data failure, data asset name '{0}', status '{1}', error message '{2}'.", dataAssetName, status.ToString(), errorMessage); Log.Warning(dataAssetName + appendErrorMessage); //throw new Exception(appendErrorMessage); }
private void LoadAssetOrBinaryFailureCallback(string dataTableAssetName, LoadResourceStatus status, string errorMessage, object userData) { string appendErrorMessage = Utility.Text.Format("Load data table failure, asset name '{0}', status '{1}', error message '{2}'.", dataTableAssetName, status.ToString(), errorMessage); if (m_LoadDataTableFailureEventHandler != null) { LoadDataTableFailureEventArgs loadDataTableFailureEventArgs = LoadDataTableFailureEventArgs.Create(dataTableAssetName, appendErrorMessage, userData); m_LoadDataTableFailureEventHandler(this, loadDataTableFailureEventArgs); ReferencePool.Release(loadDataTableFailureEventArgs); return; } throw new GameFrameworkException(appendErrorMessage); }
private void LoadDictionaryFailureCallback(string dictionaryAssetName, LoadResourceStatus status, string errorMessage, object userData) { string appendErrorMessage = Utility.Text.Format("Load dictionary failure, asset name '{0}', status '{1}', error message '{2}'.", dictionaryAssetName, status.ToString(), errorMessage); if (m_LoadDictionaryFailureEventHandler != null) { m_LoadDictionaryFailureEventHandler(this, new LoadDictionaryFailureEventArgs(dictionaryAssetName, appendErrorMessage, userData)); return; } throw new GameFrameworkException(appendErrorMessage); }
private void LoadConfigFailureCallback(string configAssetName, LoadResourceStatus status, string errorMessage, object userData) { LoadConfigInfo loadConfigInfo = (LoadConfigInfo)userData; if (loadConfigInfo == null) { throw new GameFrameworkException("Load config info is invalid."); } string appendErrorMessage = Utility.Text.Format("Load config failure, asset name '{0}', status '{1}', error message '{2}'.", configAssetName, status.ToString(), errorMessage); if (m_LoadConfigFailureEventHandler != null) { m_LoadConfigFailureEventHandler(this, new LoadConfigFailureEventArgs(configAssetName, appendErrorMessage, loadConfigInfo.UserData)); return; } throw new GameFrameworkException(appendErrorMessage); }
private void LoadSoundFailureCallback(string soundAssetName, LoadResourceStatus status, string errorMessage, object userData) { PlaySoundInfo playSoundInfo = (PlaySoundInfo)userData; if (playSoundInfo == null) { throw new GameFrameworkException("Play sound info is invalid."); } m_SoundsBeingLoaded.Remove(playSoundInfo.SerialId); m_SoundsToReleaseOnLoad.Remove(playSoundInfo.SerialId); string appendErrorMessage = Utility.Text.Format("Load sound failure, asset name '{0}', status '{1}', error message '{2}'.", soundAssetName, status.ToString(), errorMessage); if (m_PlaySoundFailureEventHandler != null) { m_PlaySoundFailureEventHandler(this, new PlaySoundFailureEventArgs(playSoundInfo.SerialId, soundAssetName, playSoundInfo.SoundGroup.Name, playSoundInfo.PlaySoundParams, PlaySoundErrorCode.LoadAssetFailure, appendErrorMessage, playSoundInfo.UserData)); return; } throw new GameFrameworkException(appendErrorMessage); }
private void LoadDataTableFailureCallback(string dataTableAssetName, LoadResourceStatus status, string errorMessage, object userData) { LoadDataTableInfo loadDataTableInfo = (LoadDataTableInfo)userData; if (loadDataTableInfo == null) { throw new GameFrameworkException("Load data table info is invalid."); } string appendErrorMessage = Utility.Text.Format("Load data table failure, asset name '{0}', status '{1}', error message '{2}'.", dataTableAssetName, status.ToString(), errorMessage); if (m_LoadDataTableFailureEventHandler != null) { m_LoadDataTableFailureEventHandler(this, new LoadDataTableFailureEventArgs(dataTableAssetName, loadDataTableInfo.LoadType, appendErrorMessage, loadDataTableInfo.UserData)); ReferencePool.Release(loadDataTableInfo); return; } ReferencePool.Release(loadDataTableInfo); throw new GameFrameworkException(appendErrorMessage); }
public void OnLoadAssetFailure(LoadResourceStatus status, string errorMessage) { if (m_MainTask != null) { m_MainTask.OnLoadAssetFailure(LoadResourceStatus.DependencyError, string.Format("Can not load dependency asset '{0}', internal status '{1}', internal error message '{2}'.", AssetBundleName, status.ToString(), errorMessage)); return; } if (m_LoadAssetCallbacks.LoadAssetFailureCallback != null) { m_LoadAssetCallbacks.LoadAssetFailureCallback(AssetBundleName, errorMessage, UserData); } }
private void InstantiateUIFormFailureCallback(string uiFormAssetName, LoadResourceStatus status, string errorMessage, object userData) { OpenUIFormInfo openUIFormInfo = userData as OpenUIFormInfo; if (openUIFormInfo == null) { throw new GameFrameworkException("Open UI form info is invalid."); } string appendErrorMessage = string.Format("Load UI form failure, asset name '{0}', status '{1}', error message '{2}'.", uiFormAssetName, status.ToString(), errorMessage); if (m_OpenUIFormFailureEventHandler != null) { m_OpenUIFormFailureEventHandler(this, new OpenUIFormFailureEventArgs(openUIFormInfo.UIFormTypeId, uiFormAssetName, openUIFormInfo.UIGroup.Name, openUIFormInfo.PauseCoveredUIForm, appendErrorMessage, openUIFormInfo.UserData)); return; } throw new GameFrameworkException(appendErrorMessage); }
void LoadAssetFail(string assetName, LoadResourceStatus status, string errorMessage, object userData) { if (m_EventManager != null) { string appendErrorMessage = Utility.Text.Format("Load UI form failure, asset name '{0}', status '{1}', error message '{2}'.", assetName, status.ToString(), errorMessage); m_EventManager.Fire(this, OpenUIFormFailureEventArgs.Create(assetName, appendErrorMessage, userData)); } }
private void LoadSoundFailureCallback(string soundAssetName, LoadResourceStatus status, string errorMessage, object userData) { LoadSoundInfo loadSoundInfo = (LoadSoundInfo)userData; if (loadSoundInfo == null) { Debug.LogError("加载声音的信息为空"); return; } m_SoundsBeingLoaded.Remove(loadSoundInfo.SerialId); m_SoundsToReleaseOnLoad.Remove(loadSoundInfo.SerialId); string appendErrorMessage = string.Format("加载声音失败,资源名: {0}, 状态: {1}, 错误信息:{2}", soundAssetName, status.ToString(), errorMessage); //派发播放声音失败事件 PlaySoundFailureEventArgs e = ReferencePool.Acquire <PlaySoundFailureEventArgs>(); m_EventManager.Fire(this, e.Fill(loadSoundInfo.UserData, loadSoundInfo.SerialId, soundAssetName, loadSoundInfo.SoundGroup.Name, loadSoundInfo.PlaySoundParams, PlaySoundErrorCode.LoadAssetFailure, appendErrorMessage)); }
private void LoadLuaScriptFailureCallback(string luaScriptAssetName, LoadResourceStatus status, string errorMessage, object userData) { LuaScriptInfo luaScriptInfo = (LuaScriptInfo)userData; string appendErrorMessage = string.Format("Load lua script failure, asset name '{0}', status '{1}', error message '{2}'.", luaScriptAssetName, status.ToString(), errorMessage); GameEntry.Event.Fire(this, ReferencePool.Acquire <LoadLuaScriptFailureEventArgs>().Fill(luaScriptInfo.LuaScriptName, luaScriptAssetName, appendErrorMessage, luaScriptInfo.UserData)); }
private void LoadAssetFailureCallback(string uiFormAssetName, LoadResourceStatus status, string errorMessage, object userData) { OpenUIFormInfo openUIFormInfo = (OpenUIFormInfo)userData; if (openUIFormInfo == null) { throw new Exception(Utility.Text.Format("Open UI form info is invalid." + errorMessage)); } if (m_UIFormsToReleaseOnLoad.Contains(openUIFormInfo.SerialId)) { m_UIFormsToReleaseOnLoad.Remove(openUIFormInfo.SerialId); return; } m_UIFormsBeingLoaded.Remove(openUIFormInfo.SerialId); string appendErrorMessage = Utility.Text.Format("Load UI form failure, asset name '{0}', status '{1}', error message '{2}'.", uiFormAssetName, status.ToString(), errorMessage); Log.Error(appendErrorMessage); return; }
private void LoadAssetFailureCallback(string entityAssetName, LoadResourceStatus status, string errorMessage, object userData) { ShowEntityInfo showEntityInfo = (ShowEntityInfo)userData; if (showEntityInfo == null) { throw new GameFrameworkException("Show entity info is invalid."); } if (m_EntitiesToReleaseOnLoad.Contains(showEntityInfo.SerialId)) { m_EntitiesToReleaseOnLoad.Remove(showEntityInfo.SerialId); return; } m_EntitiesBeingLoaded.Remove(showEntityInfo.EntityId); string appendErrorMessage = Utility.Text.Format("Load entity failure, asset name '{0}', status '{1}', error message '{2}'.", entityAssetName, status.ToString(), errorMessage); if (m_ShowEntityFailureEventHandler != null) { ShowEntityFailureEventArgs showEntityFailureEventArgs = ShowEntityFailureEventArgs.Create(showEntityInfo.EntityId, entityAssetName, showEntityInfo.EntityGroup.Name, appendErrorMessage, showEntityInfo.UserData); m_ShowEntityFailureEventHandler(this, showEntityFailureEventArgs); ReferencePool.Release(showEntityFailureEventArgs); return; } throw new GameFrameworkException(appendErrorMessage); }
private void LoadDataTableFailureCallback(string dataTableAssetName, LoadResourceStatus status, string errorMessage, object userData) { string appendErrorMessage = string.Format("Load data table failure, asset name '{0}', status '{1}', error message '{2}'.", dataTableAssetName, status.ToString(), errorMessage); if (m_LoadDataTableFailureEventHandler != null) { m_LoadDataTableFailureEventHandler(this, new LoadDataTableFailureEventArgs(dataTableAssetName, appendErrorMessage, userData)); return; } throw new AshException(appendErrorMessage); }
private void LoadUIFormFailureCallback(string uiFormAssetName, LoadResourceStatus status, string errorMessage, object userData) { OpenUIFormInfo openUIFormInfo = (OpenUIFormInfo)userData; if (openUIFormInfo == null) { throw new GameFrameworkException("Open UI form info is invalid."); } if (m_UIFormsToReleaseOnLoad.Contains(openUIFormInfo.SerialId)) { m_UIFormsToReleaseOnLoad.Remove(openUIFormInfo.SerialId); ReferencePool.Release(openUIFormInfo); return; } m_UIFormsBeingLoaded.Remove(openUIFormInfo.SerialId); string appendErrorMessage = Utility.Text.Format("Load UI form failure, asset name '{0}', status '{1}', error message '{2}'.", uiFormAssetName, status.ToString(), errorMessage); if (m_OpenUIFormFailureEventHandler != null) { OpenUIFormFailureEventArgs openUIFormFailureEventArgs = OpenUIFormFailureEventArgs.Create(openUIFormInfo.SerialId, uiFormAssetName, openUIFormInfo.UIGroup.Name, openUIFormInfo.PauseCoveredUIForm, appendErrorMessage, openUIFormInfo.UserData); m_OpenUIFormFailureEventHandler(this, openUIFormFailureEventArgs); ReferencePool.Release(openUIFormFailureEventArgs); ReferencePool.Release(openUIFormInfo); return; } ReferencePool.Release(openUIFormInfo); throw new GameFrameworkException(appendErrorMessage); }
private void LoadLuaFailureCallback(string assetName, LoadResourceStatus status, string errorMessage, object userData) { LuaFileInfo luaFileInfo = (LuaFileInfo)userData; if (luaFileInfo == null) { throw new GameFrameworkException("Load lua file info is invalid."); } string str = Utility.Text.Format("Load lua file failure, asset name '{0}', status '{1}', error message '{2}'.", (object)assetName, (object)status.ToString(), (object)errorMessage); //TODO:处理载入错误 // if (this.m_LoadDataTableFailureEventHandler == null) // throw new GameFrameworkException(str); }
private void LoadConfigFailureCallback(string configAssetName, LoadResourceStatus status, string errorMessage, object userData) { string appendErrorMessage = string.Format("Load config failure, asset name '{0}', status '{1}', error message '{2}'.", configAssetName, status.ToString(), errorMessage); if (m_LoadConfigFailureEventHandler != null) { m_LoadConfigFailureEventHandler(this, new LoadConfigFailureEventArgs(configAssetName, appendErrorMessage, userData)); return; } throw new GameFrameworkException(appendErrorMessage); }
private void LoadAssetOrBinaryFailureCallback(string dictionaryAssetName, LoadResourceStatus status, string errorMessage, object userData) { LoadDictionaryInfo loadDictionaryInfo = (LoadDictionaryInfo)userData; if (loadDictionaryInfo == null) { throw new GXException("Load dictionary info is invalid."); } string appendErrorMessage = Utility.Text.Format("Load dictionary failure, asset name '{0}', status '{1}', error message '{2}'.", dictionaryAssetName, status.ToString(), errorMessage); if (m_LoadDictionaryFailureEventHandler != null) { LoadDictionaryFailureEventArgs loadDictionaryFailureEventArgs = LoadDictionaryFailureEventArgs.Create(dictionaryAssetName, loadDictionaryInfo.LoadType, appendErrorMessage, loadDictionaryInfo.UserData); m_LoadDictionaryFailureEventHandler(this, loadDictionaryFailureEventArgs); ReferencePool.Release(loadDictionaryFailureEventArgs); return; } throw new GXException(appendErrorMessage); }
public override void OnLoadAssetFailure(LoadResourceAgent agent, LoadResourceStatus status, string errorMessage) { base.OnLoadAssetFailure(agent, status, errorMessage); m_MainTask.OnLoadAssetFailure(agent, LoadResourceStatus.DependencyError, Utility.Text.Format("Can not load dependency asset '{0}', internal status '{1}', internal error message '{2}'.", AssetName, status.ToString(), errorMessage)); }
private void LoadSceneFailureCallback(string sceneAssetName, LoadResourceStatus status, string errorMessage, object userData) { m_LoadingSceneAssetNames.Remove(sceneAssetName); string appendErrorMessage = Utility.Text.Format("Load scene failure, scene asset name '{0}', status '{1}', error message '{2}'.", sceneAssetName, status.ToString(), errorMessage); if (m_LoadSceneFailureEventHandler != null) { LoadSceneFailureEventArgs loadSceneFailureEventArgs = LoadSceneFailureEventArgs.Create(sceneAssetName, appendErrorMessage, userData); m_LoadSceneFailureEventHandler(this, loadSceneFailureEventArgs); ReferencePool.Release(loadSceneFailureEventArgs); return; } throw new GXException(appendErrorMessage); }
private void LoadEntityFailureCallback(string entityAssetName, LoadResourceStatus status, string errorMessage, object userData) { ShowEntityInfo showEntityInfo = (ShowEntityInfo)userData; if (showEntityInfo == null) { throw new System.Exception("Show entity info is invalid."); } m_EntitiesBeingLoaded.Remove(showEntityInfo.EntityId); m_EntitiesToReleaseOnLoad.Remove(showEntityInfo.EntityId); string appendErrorMessage = string.Format("Load entity failure, asset name '{0}', status '{1}', error message '{2}'.", entityAssetName, status.ToString(), errorMessage); if (m_ShowEntityFailureEventHandler != null) { m_ShowEntityFailureEventHandler(this, new ShowEntityFailureEventArgs(showEntityInfo.EntityId, entityAssetName, showEntityInfo.EntityGroup.Name, appendErrorMessage, showEntityInfo.UserData)); return; } throw new System.Exception(appendErrorMessage); }
private void LoadAssetFailureCallback(string soundAssetName, LoadResourceStatus status, string errorMessage, object userData) { PlaySoundInfo playSoundInfo = (PlaySoundInfo)userData; if (playSoundInfo == null) { throw new Exception("Play sound info is invalid."); } if (m_SoundsToReleaseOnLoad.Contains(playSoundInfo.SerialId)) { m_SoundsToReleaseOnLoad.Remove(playSoundInfo.SerialId); if (playSoundInfo.PlaySoundParams.Referenced) { ReferencePool.Release(playSoundInfo.PlaySoundParams); } return; } m_SoundsBeingLoaded.Remove(playSoundInfo.SerialId); string appendErrorMessage = Utility.Text.Format("Load sound failure, asset name '{0}', status '{1}', error message '{2}'.", soundAssetName, status.ToString(), errorMessage); if (playSoundInfo.PlaySoundParams.Referenced) { ReferencePool.Release(playSoundInfo.PlaySoundParams); } throw new Exception(appendErrorMessage); }