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); } }
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(); }
public static void Invoke_SeasonChange(int season) { SeasonChanged?.Invoke(season); }