using UnityEngine;
using System.Collections;

public class changementTextureEnvironnement : MonoBehaviour {
	
	// booléens pour le changement de texture
	public bool textureLabo;
	public bool textureDiablo;
	
	// textures à appliquer
	public Texture2D environnementLabo;
	public Texture2D environnementDiablo;
	

	// Use this for initialization
	void Start () 
	{
		textureDiablo = false;
		textureLabo = false;
	}
	
	// Update is called once per frame
	void Update () {
		
		
		// gère le changement de texture
		if (textureLabo == false && gestionAffichage.etape == "niveau1")
		{
			renderer.material.mainTexture = environnementLabo;
			textureDiablo = false;
			textureLabo = true;
		}
		
		if (textureDiablo == false&& gestionAffichage.etape == "niveau2")
		{
			renderer.material.mainTexture = environnementDiablo;
			textureLabo = false;
			textureDiablo = true;
		}
	
	}
}
