using System;
using Qoo;
using UnityEngine;

// Token: 0x02000180 RID: 384
public class MovieTex : MonoBehaviour
{
	// Token: 0x17000172 RID: 370
	// (get) Token: 0x06000ACF RID: 2767 RVA: 0x0002F668 File Offset: 0x0002D868
	public bool IsPlay
	{
		get
		{
			return this.m_tex.isPlaying;
		}
	}

	// Token: 0x06000AD0 RID: 2768 RVA: 0x0002F678 File Offset: 0x0002D878
	private void Awake()
	{
	}

	// Token: 0x06000AD1 RID: 2769 RVA: 0x0002F67C File Offset: 0x0002D87C
	private void OnDestroy()
	{
		UnityEngine.Object.Destroy(this.m_tex);
		this.m_tex = null;
	}

	// Token: 0x06000AD2 RID: 2770 RVA: 0x0002F690 File Offset: 0x0002D890
	public Material Play(string path, MOVIE_TEX_TYPE eType, bool isLoop = false)
	{
		if (path.IndexOf('/') == 0)
		{
			path = path.Substring(1);
		}
		this.m_tex = base.gameObject.AddComponent<MobileMovieTexture>();
		this.m_tex.m_path = path;
		this.m_tex.m_loop = isLoop;
		if (eType != MOVIE_TEX_TYPE.NORMAL)
		{
			if (eType != MOVIE_TEX_TYPE.ADD)
			{
				Qoo.Debug.Print("Error:MOVIE_TEX_TYPE:Unknown");
				UnityEngine.Debug.DebugBreak();
			}
			else
			{
				this.m_tex.m_movieMaterial = new Material(Resources.Load("Shader/Movie/YCrCbtoRGB Add") as Shader);
			}
		}
		else
		{
			this.m_tex.m_movieMaterial = new Material(Resources.Load("Shader/Movie/YCrCbtoRGB") as Shader);
		}
		this.m_tex.Play();
		return this.m_tex.MovieMaterial;
	}

	// Token: 0x06000AD3 RID: 2771 RVA: 0x0002F764 File Offset: 0x0002D964
	private void Update()
	{
	}

	// Token: 0x06000AD4 RID: 2772 RVA: 0x0002F768 File Offset: 0x0002D968
	public void Stop()
	{
		this.m_tex.Stop();
	}

	// Token: 0x040008C0 RID: 2240
	private MobileMovieTexture m_tex;
}
