Hi,
I have a main camera attached with lots of Image Effects, enabled from standard packages, such as CameraMotionBlur, SSAO, and Depth of Field to say a few.
My problem is, I cannot get the script objects (Ex.: GetComponent(DepthOfFieldScatter)), therefore I cannot modify their variables nor turning on/off the scripts.
However, it is completely fine with SSAOEffect. The fact that I found is, SSAOEffect script is a child of MonoBehaviour, while others' parent class is PostEffectsBase. If I have scripts or attach a script from the package with MonoBehaviour, yes it can be accessed normally.
Any idea?
Thanks.
EDIT: It might be very helpful if anyone who follow this thread could try on their own if they're willing to:
- Use Unity Pro/Pro trial 4.x (4.3 to be exact)
- Create a new project and add Image Effects (Pro only) package.
- Add SSAOEffect (Add Component -> Image Effects -> Rendering -> Screen Space Ambient Occlusion)) and add DepthOfFieldScatter (Add Component -> Image Effects -> Camera -> Depth of Field (Lens Blur, Scatter, DX11)) to main camera.
- Try to access both scripts in your own behavior script.
↧