예제 #1
0
    public void SetSeason(Season newSeason)
    {
        if (CurrentSeason != newSeason)
        {
            var oldPost = PostProcessingVolumeForSeason(CurrentSeason);
            var newPost = PostProcessingVolumeForSeason(newSeason);

            CurrentSeason = newSeason;
            newPost.gameObject.SetActive(true);

            LeanTween
            .value(gameObject, 0, 1, 1.5f)
            .setOnUpdate(value =>
            {
                if (oldPost != null)
                {
                    oldPost.weight = 1 - value;
                }
                newPost.weight = value;
            })
            .setOnComplete(() =>
            {
                if (oldPost != null)
                {
                    oldPost.gameObject.SetActive(false);
                }
            });

            groundRenderer.material = materials[newSeason];

            SeasonChanged?.Invoke(CurrentSeason);
        }
    }
예제 #2
0
 public static void ChangeSeason()
 {
     if (currentSeason == Season.Autumn)
     {
         currentSeason = Season.Winter;
     }
     else
     {
         currentSeason++;
     }
     SeasonChanged.Invoke(currentSeason);
 }
        private void UpdateFilteredChallenges()
        {
            if (SelectedSeason == null)
            {
                return;
            }

            FilteredChallenges.Clear();
            foreach (var challenge in _dataView.AllChallenges)
            {
                if (!SelectedSeason.ContainsChallenge(challenge.Id))
                {
                    FilteredChallenges.Add(challenge);
                }
            }

            SeasonChanged?.Invoke();
        }
예제 #4
0
 public static void Invoke_SeasonChange(int season)
 {
     SeasonChanged?.Invoke(season);
 }