Enable/Disable shader on script

So, I’m working on action horror game. There is an enemy in this game. I want when the enemy attack, (this shader) will be enabled on camera.

However I am unsure of how to disable/enable the shader in the camera, anyone has any idea how?

Understand that a shader is sort of like a template for a material, telling the camera how to actually “see” the material. Because shaders are merely templates, you can’t actually enable or disable them (you shouldn’t even need to alter them during runtime).

However the material, which is the instance of a shader given to the GameObject, can be altered to suit your needs. You can switch the shader your material is using with Shader.Find, you can actually enable/disable the renderer displaying your GameObject like shown here, or you can set the attributes of the material using renderer.material.

If you have any questions feel free to ask and if you want to know what to do in your specific situation then elaborate more on what you want done in your game like the actual effect you’re trying to create. An example of a game using the effect would be very helpful.

I suspect from your description that you may be thinking of an image effect rather than a shader. They are similar in many respects, but rather than change how an individual material on an object is drawn to the screen, an image effect alters the entire image rendered by a camera.

Image effects can be used for things like adding dirt to a lens, adding blurs and depth of field effects etc. However, note that they are only available in Unity Pro.

Either that, or you might be able to create the effect you want by placing a transparent plane or GUITexture in front of the camera, and applying effects to that. For an example, see @aldonaletto’s answer in blood damage like call of duty? - Unity Answers