Accessing Screen Space Ambient Obscurance on Runtime

Hi,
Since SSAObscurance is newer, better and more optimized than SSAOcclusion as indicated here: http://docs.unity3d.com/Documentation/Components/script-AmbientObscurance.html
I am using it for my project.

However, I cannot reach this script from other scripts like I can in SSAO.
For example,

Camera.main.GetComponent<SSAOEffect> ().enabled = UIToggle.current.value;

is possible, but I cannot do that with Obscurance.

Is it possible?
Thanks.

First, are you sure that when you call Camera.main you get your Camera with AmbientObscurance.

If you want to call you AmbientObscurance from a C# class, you’ll need to move the AmbientObscurance script in the Plugins folder like explained here:
Unity3D: JavaScript->C# or C#->JavaScript access
.

Then you can call it like this.

AmbientObscurance ao = Camera.main.GetComponent<AmbientObscurance>();
ao.enabled = false;

The strange thing is that normally if the script is put in the Standard Assets folder it should be compiled before others and then should be accessible but this is not the case…

If you don’t want to change the script’s place, you can try calling it with a js script.