using UnityEngine;
using System.Collections;

public class Ammo : MonoBehaviour {
	
	public Texture2D ammoImg;  		//image zone de  chargement
	public Texture2D notAmmoImg;  	//image zone de  chargement
	
	// Use this for initialization
	void Start () 
	{
		Game.ammoZone =notAmmoImg ;
	}
	
	// Update is called once per frame
	void Update () {
	
	}
	
	void OnTriggerEnter(Collider other)
	{
		if (other.name == "cameraSensor")
		{
			Debug.Log ("zone de rechargement");
			Game.ammoZone = ammoImg;
		}
	}
	
	void OnTriggerExit(Collider other)
	{
		if (other.name == "cameraSensor")
		{
			Game.ammoZone = notAmmoImg;
			Debug.Log ("Sortie");
		}
	}
	
	void OnTriggerStay(Collider other)
	{
		if (other.name == "cameraSensor")
		{
			if (Input.GetMouseButtonDown(2))
			{
				Game.snowBallMagazine = Game.snowBallLvl;
			}
		}
	}
}
