コード例 #1
0
        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;
        }
コード例 #2
0
 private void UpdateMoneyTexts()
 {
     currentMoneyText.text = gameManager.GetMoney().ToString();
     Debug.Log("UpdateMoneyTexts: " + currentMoneyText.text);
 }