With all of our assets gathered and the screen effect system running smoothly, let's begin to add the code necessary to both the script and shader. We will begin our coding with the RenderNightVision.cs script, so double-click on this file now to open it in your code editor of choice:
- We will begin by entering the code in our script. Our first step in modifying our script is to rename the class to match our filename, RenderNightVision:
[ExecuteInEditMode]public class RenderNightVision : MonoBehaviour {
- We need to create a few variables that will allow the user of this effect to adjust it in the script's Inspector. Enter the following code in the NightVisionEffect.cs script:
#region Variables public Shader curShader; public ...