private void closeWin(UIWin win, object message, bool doRefresh) { doClose(win, message); if (win.type == UIType.Update) { if (doRefresh && !refreshing) { refreshing = true; if (openWins.Count > 0) { UIWin lastWin = openWins.Last.Value; if (lastWin && lastWin.type != UIType.Main) { lastWin.Refresh(); lastWin.gameObject.SetActive(true); } } refreshing = false; } else { if (openWins.Count > 0) { UIWin lastWin = openWins.Last.Value; if (lastWin && lastWin.type != UIType.Main) { lastWin.gameObject.SetActive(true); } } } } }
private void CloseNormalWin(UIWin win, bool doRefresh) { openedNormalWins.Remove(win); //remove it from normalWins if (doRefresh && !refreshing) { refreshing = true; //back to the last win if there is if (openedNormalWins.Count > 0) { //show back the last win UIWin lastWin = openedNormalWins.Last.Value; if (lastWin) { lastWin.Refresh(); lastWin.gameObject.SetActive(true); } } refreshing = false; } }