public void CloseScreen() { Vector3 pos = transform.position; pos.z -= 3; pos.y = 0; Player.transform.position = pos; Player.transform.Rotate(0, 180, 0); Player.SetInputEnabled(true); EndDayScreen.SetActive(false); int total = 0; foreach (Inventory.InventoryItem inventoryItem in inventory.ChestStorage) { if (inventoryItem.PlayerAction == PlayerAction.Seed) { total += inventoryItem.Amount * DataStore.ItemBalancingData[inventoryItem.ItemName].Price; } else { total += inventoryItem.Amount * DataStore.ItemBalancingData[inventoryItem.ItemName].AvgSellingPrice; } } inventory.ChestStorage.Clear(); inventory.AddCoins(total); farmingManager.UpdateFarmPatches(); }
private void HandleKeys() { foreach (KeyCode key in movementKeys) { if (Input.GetKeyDown(key)) { pressedKeys.Add(key); } if (Input.GetKeyUp(key)) { pressedKeys.Remove(key); } } foreach (KeyCode key in alphaKeys.Keys) { if (Input.GetKeyDown(key)) { inventory.SelectItem(alphaKeys[key]); uiController.SwitchSelection(alphaKeys[key]); } } if (Input.GetKeyDown(KeyCode.B)) { farmingManager.UpdateFarmPatches(); } }