How to simplify scene by loading scripts, materials in runtime?

Hello to all. I’m new to Unity and JS scripting and I need a helpful hand to make my scene much simpler and my code in app smarter. Here is the concept of my scene:

There is a Camera, that sees through layer masking three planes. Also there is a material that acts as a swapping texture, and a script that runs this swapping respectively on each plane. In order to run this script, I use a GUI with a scroll list buttons, so when button1 is pressed, camera sees only plane1 and the script1 runs the texture material1 on this plane. The same happens on the other 2 planes by pressing the corresponding buttons. You can get a view of this concept in the attached image 1.

What I need your help for, is to simplify this scene setting by keeping only one plane for the camera to be seen, and attaching the respective scripts (1, 2, 3), material as texture (1, 2, 3) on this same plane when the player touches the corresponding GUI buttons, in runtime. You can get a view of this concept in the attached image 2.

I believe this functionality can be achieved by using e.g. “gameObject.AddComponent (“myScript”)” , but as I’m a noob, I cannot make it happen. Furthermore, I do not know how to apply the different material on this plane in runtime. So I need some help and a coding example maybe, as I find it difficult to follow only tips without seeing an example.

Thank you all for your time reading this post, hope someone be kind enough to help me on this matter.

What the scripts exactly does on the plane, just enable disable material?

Hello @ . Well the script is a texture animator, similar to one at Unity wiki. The material is a png image sequence that the script run on plane in runtime. So I want to attach script1 and material1 on the plane in runtime, to avoid having more than one planes with the same script and different materials as texture animation. Does this makes sense now?