A custom Action would do this easily - but it would be too specific for the needs of your own game to add officially. You can find more about custom actions here.
having AC manage the copy/clear process of the image effects would be a big help for me aswell. I'd second @danielvierna suggestion of having all effects on the gameCameras with their specific settings (like DOF, color corrections) which then get copied to the mainCamera during runtime automatically.
This would mean AC could support all image effects (even custom) (+without the need to update anything, when Unity changes something)
@deroesi: For the record, I did attempt to implement a generic value "copier" - but there were serious problems with it and it wasn't possible to make stable enough for an official release.
So long as you know the components/values you want to carry over, a custom script would be incredibly simple - but it would only work for your specific game's needs.
I developed a custom playmaker fsm that does the trick, it copies the required values with no problems.
If anyone using playmaker needs the same, I'll be happy to share the method; it's not flexible but it does the job.
Chris, I checked the forum without luck, is it possible to use layers to apply post processing just to certain objects? If so, how to do that using your main camera?
It's along the same lines I explored previously. The same issues apply, and while you could easily implement this through custom code for your own game, it's not something that should be added officially.
well fine i give up then.... but I honestly don't see a reason why supporting - official - camera effects would be that "wrong" on your part, not everybody knows how to do it, and i think every new client of AC expects this to work properly.
-and this was my last sentence on this subject don't worry
The sample code I wrote was just an example - "MyEffect" is a stand-in for the actual component you'd use in your own project, it's not a reference to a real component.
What are you trying to do, exactly? If you're using Unity's own Post Process Volumes, then you can blend between different volumes via the Volume Blending feature.
One approach you could take is to set the Trigger field to an Empty GameObject, parent it to the MainCamera, and then use the **Object: Parent** / **Object: Teleport** Actions to detach it and position it inside different Volumes when you want an effect to kick in.
Comments
having AC manage the copy/clear process of the image effects would be a big help for me aswell. I'd second @danielvierna suggestion of having all effects on the gameCameras with their specific settings (like DOF, color corrections) which then get copied to the mainCamera during runtime automatically.
This would mean AC could support all image effects (even custom) (+without the need to update anything, when Unity changes something)
So long as you know the components/values you want to carry over, a custom script would be incredibly simple - but it would only work for your specific game's needs.
http://answers.unity3d.com/questions/530178/how-to-get-a-component-from-an-object-and-add-it-t.html
could this be implemented into AC?
-and this was my last sentence on this subject don't worry
Hello,
So I tried this code to turn on and off an effect of the Main Camera.
The first error I get is this. Not sure why because my file name and class are the same:
Second I get these errors. It doesn't seem to know what "My Effects" is. Do I have to change it to something else? I am VERY VERY bad at coding.
What are you trying to do, exactly? If you're using Unity's own Post Process Volumes, then you can blend between different volumes via the Volume Blending feature.
One approach you could take is to set the Trigger field to an Empty GameObject, parent it to the MainCamera, and then use the **Object: Parent** / **Object: Teleport** Actions to detach it and position it inside different Volumes when you want an effect to kick in.