Пример #1
0
    public void EndTurn()
    {
        if (sectorInfoPanel.activeInHierarchy == false && gameOver.gameLost != true && pause.pauseMenuUp == false && eventUI.eventPanelUp != true)
        {
            totalCrime     = 10;
            totalCrimeRate = 10;
            currentTurn   += 1;
            foreach (GameObject sector in sectors)
            {
                sector.GetComponent <SectorInfo>().UpdateSector();
            }
            infoPanel.SetInfo();
            powAndAprov.UpdatePowerAndAproval();
            playerMoney.UpdateMoney();


            if (Random.Range(0, 100) <= 30)
            {
                eventHandler.ChooseBaseEvent();
            }
            turnCounter.text = "Turn: " + currentTurn.ToString();
            foreach (GameObject sector in sectors)
            {
                totalCrimeRate += sector.GetComponent <SectorInfo>().crimeRate;
                totalCrime     += sector.GetComponent <SectorInfo>().crimeLevel;
            }
            if (totalCrime == 0 && totalCrimeRate == 0)
            {
                gameOver.GameWon();
            }
            sectorOverlayHandler.UpdateOverlays();
        }
    }