Is this the correct way?

Hi, is this he correct way to change a shader and texture of a model from one to another in runtime, or is there a more efficient way of doing it?

var shader1 : Shader;
var shader2 : Shader;
var material1 : Material;
var material2 : Material;
var material3 : Material;
var testbot : GameObject;
var testGun : GameObject;

function Start () {

    shader1 = Shader.Find("Mobile/VertexLit");
    shader2 = Shader.Find("Mobile/Diffuse");

function Update () {

	if (Input.GetButtonDown("Jump")) {
		if( testbot.renderer.material.shader == shader1 ){
			testbot.renderer.material.shader = shader2;
			testbot.renderer.material = material2;

			testGun.renderer.material.shader = shader2;
			testGun.renderer.material = material2;
			testbot.renderer.material.shader = shader1;
			testbot.renderer.material = material1;

			testGun.renderer.material.shader = shader1;
			testGun.renderer.material = material3;

It is the easiest way and i think that also the best.
Next time, think about better title.

If you only want to change the appearances of a few objects in the scene, it’s the correct way, but if you want to render the whole scene with a different set of shaders, you should use replacement shaders:here.