/* * 清理方法 清理所有子窗口 */ public override void Dispose() { for (int i = wins_.Count - 1; i >= 0; --i) { UI ui = wins_[i]; wins_.RemoveAt(i); ui.Dispose(); } //卸载警告窗资源 ResourceUtil.UnLoadGameObjectFromAb(PREFAB_NAME_ALERT); ResourceUtil.UnLoadGameObjectFromAb(PREFAB_NAME_DOUBLECHECK); }
//---------------私有方法----------------------------- private void closeWin(UI win) { if (wins_.Contains(win)) { wins_.Remove(win); /* * 优化点 对象池 */ win.Dispose(); } checkCloseBg(); }