public void HideUI() { foreach (UIButton button in buttons) { button.Unregister(drawer); } foreach (UIWall uiWall in uiWalls) { uiWall.Unregister(drawer); } if (uiPlayer != null) { uiPlayer.Unregister(drawer); } if (uiAIPlayer != null) { uiAIPlayer.Unregister(drawer); } if (food != null) { uiFood.Unregister(drawer); } if (btnPause != null) { btnPause.Unregister(drawer); } if (btnReplay != null) { btnReplay.Unregister(drawer); } if (btnContinue != null) { btnContinue.Unregister(drawer); } }