Ejemplo n.º 1
0
    public void ConfirmInvestment()
    {
        if (GameManager.Singleton.CurrentGameState == GameState.SET_OVER)
        {
            return;
        }

        if (InvestmentManager.Singleton.PlayerInterestedBoat.IsRobbed)
        {
            return;
        }

        for (int i = 0; i < goodsCount; ++i)
        {
            GoodInvestment good = goods[i];
            if (good.IsSelected)
            {
                good.Invest(i);
                break;
            }

            if (i == goodsCount - 1)
            {
                return;
            }
        }
        CloseUI();
        currentPlayerSelected = null;
        //GameManager.Singleton.ShowBoat();
        GameManager.Singleton.PlayerFinishRoundPlay();
    }
Ejemplo n.º 2
0
    private void OnGoodInvestmentClick(GoodInvestment investment)
    {
        if (GameManager.Singleton.CurrentGameState == GameState.SET_OVER)
        {
            return;
        }

        if (InvestmentManager.Singleton.PlayerInterestedBoat.IsLandOnHarbor ||
            InvestmentManager.Singleton.PlayerInterestedBoat.IsLandOnTomb)
        {
            return;
        }

        int cost = int.Parse(investment.cost.text);

        if (GameManager.Singleton.CurrentPlayer.Money < cost)
        {
            return;
        }

        if (currentPlayerSelected != null)
        {
            currentPlayerSelected.UnSelected();
        }

        currentPlayerSelected = investment;
    }