Attaching and Removing a script to the main camera

Hi there,

I have a copy of the pro licence, I want to be able to control the scripts that I attach to the main camera: blur, sepia etc etc. How do I do this? How do I script that when the character collides with an object an effect gets turned on on the camera?

Many thanks!
Matthew

To add one:

 gameObject.AddComponent("TypeNameOfTheScriptYouWantToAdd") 

or

gameObject.AddComponent(typeof(TypeOfTheScriptYouWantToAdd))

To remove:

 Component.Destroy(instanceOfScriptToDestroy)

On the main camera that will look like Camera.main.gameObject.AddComponent etc

Say you have a script MyBehaviour:

Camera.main.gameObject.AddComponent(typeof(MyBehaviour))

To remove you could do this:

foreach(var c in Camera.main.gameObject.GetComponents<MyBehaviour>())
     Component.Destroy(c);

This latter is a catch all in case you added more than one of the component. If there is only one for sure:

Component.Destroy(Camera.main.gameObject.GetComponent<MyBehaviour>());