## Increasing and Decreasing Bloom Intensity##
I'm trying to increase and decrease the bloom from 1-10 and back over time.
The bloom intensity starts at 1 and I want it to increase up to 10 and then lower back to 1 but it increases over time but carries on past 10.
Here's my code:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.PostProcessing;
public class CamMovement : MonoBehaviour {
public PostProcessingProfile profile;
void Start(){
BloomModel.Settings bloomSettings = profile.bloom.settings;
bloomSettings.bloom.intensity = 1;
}
void Update(){
BloomModel.Settings bloomSettings = profile.bloom.settings;
if (bloomSettings.bloom.intensity >= 10) {
bloomSettings.bloom.intensity = (bloomSettings.bloom.intensity - 0.5f) * Time.time;
}
if (bloomSettings.bloom.intensity <= 1) {
bloomSettings.bloom.intensity = (bloomSettings.bloom.intensity + 0.5f) * Time.time;
}
Debug.Log ("Bloom Intensity: " + bloomSettings.bloom.intensity);
profile.bloom.settings = bloomSettings;
}
}
↧