public void IWannaBuy() { if (!_state) { MyMaster.OpenWindowCosmetics(Title, Cost, MyCosmetics); } else if (G.Sys.dataMaster.EquippedCosmetic != MyCosmetics) { G.Sys.dataMaster.EquippedCosmetic = MyCosmetics; Debug.Log(MyCosmetics.ToString() + " equipped " + G.Sys.dataMaster.EquippedCosmetic.ToString()); Event <ShopResetEvent> .Broadcast(new ShopResetEvent()); } }
public void Buy() { G.Sys.dataMaster.Coins -= _currentPrice; if (_isPowerUp) { G.Sys.dataMaster.SetPowerupLevel(G.Sys.dataMaster.PowerupLevel(_currentPowerUp) + 1, _currentPowerUp); ShopWindow.SetActive(false); Event <ShopResetEvent> .Broadcast(new ShopResetEvent()); Debug.Log(_currentPowerUp.ToString() + " " + G.Sys.dataMaster.PowerupLevel(_currentPowerUp)); } else { G.Sys.dataMaster.SetCosmeticsLevel(true, _currentCosmetics); ShopWindow.SetActive(false); Event <ShopResetEvent> .Broadcast(new ShopResetEvent()); Debug.Log(_currentCosmetics.ToString() + " " + G.Sys.dataMaster.CosmeticsLevel(_currentCosmetics).ToString()); } }