private void OnConfirm() { Item currItem = StoreManager.ItemSelected; if (currItem == null) { return; } if (PlayerData.Instance.Currency - currItem.Price < 0) { //Insufficient funds this.Owner.ChangeState <InsufficientState>(); } else { PlayerData.Instance.Currency -= currItem.Price; PlayerData.Instance.Items.Add(currItem); MessageController.ClearOverlay(); this.PostNotification(MenuHeader.OnHeaderUpdateNotification); this.Owner.ChangeState <ShopState>(); } MessageController.Clean(); }
public override void Enter() { //Any game specific initializations are done here PlayerData.Instance.Initialize(); this.PostNotification(MenuHeader.OnHeaderUpdateNotification); MenuHeader.OnShopButtonClicked += OpenShop; MenuHeader.OnInventoryClicked += OpenInventory; MessageController.ClearOverlay(); }
private void OnConfirm() { Item currItem = StoreManager.ItemSelected; if (currItem == null) { return; } PlayerData.Instance.Currency += currItem.Price; InventoryGrid.Remove(currItem); PlayerData.Instance.Items.Remove(currItem); MessageController.ClearOverlay(); this.PostNotification(MenuHeader.OnHeaderUpdateNotification); this.Owner.ChangeState <InventoryState>(); MessageController.Clean(); }
private void OnCancel() { MessageController.ClearOverlay(); MessageController.Clean(); this.Owner.ChangeState <ShopState>(); }