/// <summary> /// Hides the shop window & saves the state of bought items /// </summary> private void CloseShop() { _currentTab.Hide(); _screen.Close(); SaveManager.Save(); }
private void InitCategories(ShopCategory[] setupCategories) { // init array _shopTabs = new ShopTabView[setupCategories.Length]; // loop over all available categories - they come from the setup, see ShopCategory for (int index = 0; index < setupCategories.Length; index++) { // the current category ShopCategory setupCategory = setupCategories[index]; // spawn it ShopTabView tabView = Instantiate(_tabViewPrefab); tabView.InitTab(setupCategory); tabView.Hide(); _shopTabs[index] = tabView; // spawn the button opening the tab ShopTabButton tabButton = Instantiate(_tabButtonPrefab); tabButton.Init(index, setupCategory.name); // add tab to the screen _screen.AddTab(tabView, tabButton); } }