Add MVP ambient biome audio hook

This commit is contained in:
2026-05-19 12:01:24 -07:00
parent c37d8d930c
commit fb658baff0
5 changed files with 89 additions and 12 deletions
@@ -83,7 +83,9 @@ void AAgrarianWeatherAudioController::RefreshWeatherAudio(float DeltaSeconds)
break;
}
const float TargetAmbientVolume = GameState->IsNight() ? AmbientNightVolume : AmbientDayVolume;
const float DayAmbient = FMath::Max(AmbientDayVolume, BiomeAmbientDayVolume);
const float NightAmbient = FMath::Max(AmbientNightVolume, BiomeAmbientNightVolume);
const float TargetAmbientVolume = GameState->IsNight() ? NightAmbient : DayAmbient;
const float InterpSpeed = FMath::Max(0.1f, VolumeInterpSpeed);
CurrentAmbientVolume = FMath::FInterpTo(CurrentAmbientVolume, TargetAmbientVolume, DeltaSeconds, InterpSpeed);
CurrentRainVolume = FMath::FInterpTo(CurrentRainVolume, TargetRainVolume, DeltaSeconds, InterpSpeed);
@@ -106,7 +108,11 @@ void AAgrarianWeatherAudioController::RefreshWeatherAudio(float DeltaSeconds)
void AAgrarianWeatherAudioController::AssignConfiguredSounds()
{
if (AmbientAudio && ClearAmbientSound)
if (AmbientAudio && BiomeAmbientLoopSound)
{
AmbientAudio->SetSound(BiomeAmbientLoopSound);
}
else if (AmbientAudio && ClearAmbientSound)
{
AmbientAudio->SetSound(ClearAmbientSound);
}