I have a main camera in my scene with a Sun Shafts (Script) ImageEffect on it.
[![enter image description here][1]][1]
(I'm using Medieval Environment asset.)
I'd like to disable this effect programmatically when main camera reaches a specific coordinate.
Please kkep in mind, that the script I'd like to disable is a .js script.
So here is my code:
foreach(Camera c in GameObject.FindObjectsOfType(typeof(Camera)))
{
if ((c.name == "Main Camera"))
{
if ((c.transform.position.x < -10))
{
//Disable Sun Shafts effect
}
}
}
How to disable Sun Shafts effect programmatically?