/// <summary> /// 关闭UI /// </summary> /// <param name="UI">目标UI</param> /// <param name="isPlayAnim">是否播放关闭动画</param> /// <param name="callback">动画播放完毕回调</param> /// <param name="objs">回调传参</param> public static void CloseUIWindow(UIWindowBase UI, bool isPlayAnim = true, UICallBack callback = null, params object[] objs) { RemoveUI(UI); //移除UI引用 UI.RemoveAllListener(); s_UILayerManager.RemoveUI(UI); if (isPlayAnim) { //动画播放完毕删除UI if (callback != null) { callback += CloseUIWindowCallBack; } else { callback = CloseUIWindowCallBack; } s_UIAnimManager.StartExitAnim(UI, callback, objs); } else { CloseUIWindowCallBack(UI, objs); } }
/// <summary> /// 关闭UI /// </summary> /// <param name="UI">目标UI</param> /// <param name="isPlayAnim">是否播放关闭动画</param> /// <param name="callback">动画播放完毕回调</param> /// <param name="objs">回调传参</param> public static void CloseUIWindow(UIWindowBase UI, bool isPlayAnim = true, UICallBack callback = null, params object[] objs) { //从显示UI中移除UI RemoveUI(UI); //层级管理 m_uiLayerManager.RemoveUI(UI); //是否有退出动画 if (isPlayAnim) { //动画播放完毕删除UI if (callback != null) { callback += CloseUIWindowCallBack; } else { callback = CloseUIWindowCallBack; } m_uiAnimManager.StartExitAnim(UI, callback, objs); } else { CloseUIWindowCallBack(UI, objs); } }