// Use this for initialization public void openShopWindow() { if (FirstOpenShop == true) { if (ShopActive == false) { shopWindow.SetActive(true); shopsystem = this; FillList(); UpdateUI(); ShopActive = true; FirstOpenShop = false; } else { ShopActive = false; FirstOpenShop = false; } } if (FirstOpenShop == false) { if (ShopActive == false) { shopWindow.SetActive(true); } ShopActive = false; } }