コード例 #1
0
ファイル: SeasonSlider.cs プロジェクト: 7aylor/Unity
    /// <summary>
    /// Resets the season slider and triggers the season change
    /// </summary>
    private void ResetSeasonSlider()
    {
        int goldEarned = gold.GetGoldAmount();

        //get the total gold harvest for this season
        gold.SetGoldAmount(goldEarned + hc.GetSeasonsHarvest());

        //check if we are in the final season
        if (seasonText.GetCurrentSeason() == "Fall")
        {
            gameSummary.gameObject.SetActive(true);
            gameSummary.CalculateGameSummary();
        }

        //triggers a season change. Lots to calculate

        //update the season summary stuff
        SeasonSummary.SetActive(true);
        SeasonSummaryText.text = seasonText.GetCurrentSeason() + " Summary";
        CropsHarvested.text    = hc.GetNumberOfCropsHarvested().ToString();
        CropsEaten.text        = deer.NumCropsEaten.ToString();
        //crops in season
        CropsInSeason.text = hc.CropsInSeason.ToString();

        TotalGoldEarned.text    = hc.GetSeasonsHarvest().ToString();
        HighestEarningCrop.text = hc.GetHighestEarnedCrop() + " " + hc.GetHighestEarnedCropAmount();

        //update UI elements
        slider.value = 0;
        background.ChangeBackgroundImage();
        seasonText.changeSeasonText();
        symbols.UpdateSeasonSymbol();
        market.SpawnMarketCardImages();
    }