Changing Movie Textures.

Hello all,

I currently have a Movie texture that is running on a raw image on the UI in my scene.

As it currently stands I am getting the issue that it wont convert my textures. I must be doing something wrong as i just want to replace what is in the texture field of the raw image.

using UnityEngine;
using UnityEngine.UI;
using System.Collections;

public class updateplayer : MonoBehaviour {

	public RawImage movietexture;
	MovieTexture mt;
	public MovieTexture Movie1;
	public MovieTexture Movie2;
	public int Movienumber;

	void start(){
		Movienumber = 1;
	}

	void Update () {
		if (Input.GetKey (KeyCode.A)) {

			mt = (MovieTexture)movietexture.mainTexture;
			if (mt.isPlaying) {
				mt.Pause();
			}
			else {
				mt.Play();
			}
		}
		if (Movienumber == 1) {
			movietexture = Movie1;
		}
		if (Movienumber == 2) {
			movietexture = Movie2;
		}
	}

	public void add(){
		Movienumber = Movienumber + 1;
	}
}

Sorry guys answered my own question.

You simply turn movietexture = Movie1; to movietexture.texture = Movie1;