I’m trying to use GetComponent to change Bloom settings on runtime, with no success on retrieving the component, any idea of how can I access and change parameters thru script? my performance controller is written on C#, so it would be nice if I could implement that on it without creating a new JS script…
This is my performance control script:
using UnityEngine;
using System.Collections;
public class DMPerfCTR : MonoBehaviour {
private GameObject[] psfx;
private GameObject[] fog;
private float fogdf;
private float pefxdf;
private int curSSAO;
// Update is called once per frame
void Update () {
if(GetComponent<DataManager>().uiperformance != null){
fogdf = GetComponent<DataManager>().fogdretu;
pefxdf = GetComponent<DataManager> ().pefdretu;
curSSAO = GetComponent<DataManager>().curSSAO;
}
//density of fog's particles
fog = GameObject.FindGameObjectsWithTag ("Fog");
for(int i = 0; i < fog.Length; ++i){
fog*.GetComponent<PSperformance>().erperctAmount = fogdf;*
-
}*
-
//density of particle effects, such as explosions, fire etc...*
-
psfx = GameObject.FindGameObjectsWithTag ("FXParticles");*
-
for(int i = 0; i < psfx.Length; ++i){*
_ psfx*.GetComponent().erperctAmount = pefxdf;_
_ }_
_ //SSAO*_
* if(curSSAO == 0){*
* Camera.main.GetComponent ().enabled = false;;*
* }*
* if(curSSAO == 1){*
* Camera.main.GetComponent().enabled = true;*
* Camera.main.GetComponent ().m_SampleCount = SSAOEffect.SSAOSamples.Low;
_ }_
_ if(curSSAO == 2){_
_ Camera.main.GetComponent().enabled = true;_
Camera.main.GetComponent ().m_SampleCount = SSAOEffect.SSAOSamples.Medium;
_ }_
_ if(curSSAO == 3){_
_ Camera.main.GetComponent().enabled = true;_
Camera.main.GetComponent ().m_SampleCount = SSAOEffect.SSAOSamples.High;
_ }_
_ }_
_}*_
I use a diferent script for AA and resolution