public void AddPlayerOnTile(GameObject buttonRefered) { if (currentPlayerTypeSelected < 0) { return; } if (gameManager.GetMoney() - 50 < 0) { return; } var player = Instantiate(playerPrefabs[currentPlayerTypeSelected], playersGroup.transform); var button = buttonRefered.GetComponent <Button>(); player.transform.position = button.transform.position; player.GetComponent <Player>().SetButtonRefered(button); button.interactable = false; gameManager.DecreaseMoney(50); if (gameManager.GetMoney() - 50 < 0) { button.interactable = false; } currentPlayerTypeSelected = -1; }
private void UpdateMoneyTexts() { currentMoneyText.text = gameManager.GetMoney().ToString(); Debug.Log("UpdateMoneyTexts: " + currentMoneyText.text); }