private void LoadUIFormDependencyAssetCallback(string uiFormAssetName, string dependencyAssetName, int loadedCount, int totalCount, object userData) { OpenUIFormInfo openUIFormInfo = (OpenUIFormInfo)userData; if (openUIFormInfo == null) { throw new Exception("Open UI form info is invalid."); } if (m_OpenUIFormDependencyAssetEventHandler != null) { m_OpenUIFormDependencyAssetEventHandler(openUIFormInfo.SerialId, uiFormAssetName, openUIFormInfo.UIGroup.Name, openUIFormInfo.PauseCoveredUIForm, dependencyAssetName, loadedCount, totalCount, openUIFormInfo.UserData); } }
private void LoadUIFormUpdateCallback(string uiFormAssetName, float progress, object userData) { OpenUIFormInfo openUIFormInfo = (OpenUIFormInfo)userData; if (openUIFormInfo == null) { throw new Exception("Open UI form info is invalid."); } if (m_OpenUIFormUpdateEventHandler != null) { m_OpenUIFormUpdateEventHandler(openUIFormInfo.SerialId, uiFormAssetName, openUIFormInfo.UIGroup.Name, openUIFormInfo.PauseCoveredUIForm, progress, openUIFormInfo.UserData); } }
private void LoadUIFormFailureCallback(string uiFormAssetName, string errorMessage, object userData) { OpenUIFormInfo openUIFormInfo = (OpenUIFormInfo)userData; if (openUIFormInfo == null) { throw new Exception("Open UI form info is invalid."); } m_UIFormsBeingLoaded.Remove(openUIFormInfo.SerialId); m_UIFormsToReleaseOnLoad.Remove(openUIFormInfo.SerialId); string appendErrorMessage = TextUtil.Format("Load UI form failure, asset name '{0}', error message '{1}'.", uiFormAssetName, errorMessage); if (m_OpenUIFormFailureEventHandler != null) { m_OpenUIFormFailureEventHandler(openUIFormInfo.SerialId, uiFormAssetName, openUIFormInfo.UIGroup.Name, openUIFormInfo.PauseCoveredUIForm, appendErrorMessage, openUIFormInfo.UserData); return; } throw new Exception(appendErrorMessage); }
private void LoadUIFormSuccessCallback(string uiFormAssetName, UnityEngine.Object uiFormAsset, float duration, object userData) { OpenUIFormInfo openUIFormInfo = (OpenUIFormInfo)userData; if (openUIFormInfo == null) { throw new Exception("Open UI form info is invalid."); } m_UIFormsBeingLoaded.Remove(openUIFormInfo.SerialId); if (m_UIFormsToReleaseOnLoad.Contains(openUIFormInfo.SerialId)) { m_UIFormsToReleaseOnLoad.Remove(openUIFormInfo.SerialId); GameEntry.Resource.UnloadAsset(uiFormAsset); return; } UIFormInstanceObject uiFormInstanceObject = new UIFormInstanceObject(uiFormAssetName, uiFormAsset, UnityEngine.Object.Instantiate(uiFormAsset)); m_InstancePool.Register(uiFormInstanceObject, true); InternalOpenUIForm(openUIFormInfo.SerialId, uiFormAssetName, openUIFormInfo.UIGroup, uiFormInstanceObject.Target, openUIFormInfo.PauseCoveredUIForm, true, duration, openUIFormInfo.UserData); }