Complete the code to enable the Bloom effect on the Volume component.
var volume = GetComponent<Volume>(); if (volume.profile.TryGet(out Bloom bloom)) { bloom.intensity.overrideState = [1]; }
Setting bloom.intensity.overrideState to true enables the Bloom effect.
Complete the code to set the intensity of the Bloom effect to 1.5.
var volume = GetComponent<Volume>(); if (volume.profile.TryGet(out Bloom bloom)) { bloom.intensity.value = [1]; }
Setting bloom.intensity.value to 1.5f adjusts the bloom intensity to 1.5.
Fix the error in the code to properly set the color filter in Color Adjustments.
var volume = GetComponent<Volume>(); if (volume.profile.TryGet(out ColorAdjustments colorAdjustments)) { colorAdjustments.colorFilter.value = [1]; }
The colorFilter.value expects a Color object. new Color(1, 0, 0) correctly creates a red color.
Fill both blanks to create a VolumeProfile and add Bloom and Color Adjustments effects.
var profile = ScriptableObject.CreateInstance<VolumeProfile>(); profile.[1](out Bloom bloom); profile.[2](out ColorAdjustments colorAdjustments);
Use Add to add effects like Bloom and Color Adjustments to the VolumeProfile.
Fill all three blanks to set up a Volume component with a profile and enable Bloom with intensity 2.0.
var volume = gameObject.AddComponent<Volume>(); volume.isGlobal = [1]; volume.profile = [2]; if (volume.profile.TryGet(out Bloom bloom)) { bloom.intensity.overrideState = true; bloom.intensity.value = [3]; }
Set isGlobal to true for global effect, assign the profile to the volume, and set bloom intensity to 2.0f.