using UnityEngine;
using System.Collections;

public class Stamina_7 : MonoBehaviour {

	public Bar staminaBar;
	public Globals globals;
	
	public bool spanPlayer;
	public GameObject Play;
	float posX;
	float posY;
	float posZ;
	
	// Use this for initialization
	void Start () {
		
		spanPlayer = false;
		
		posX = transform.position.x;
		posY = -0.8f;
		posZ = transform.position.z;
		
		
		
	}
	
	void OnTriggerStay (Collider coll){
		
		
		if(staminaBar.barDisplay < 1){		
			staminaBar.barDisplay = staminaBar.barDisplay + 0.15f * Time.deltaTime;
			globals.checkPoint.x = posX;
			globals.checkPoint.y = posY;
			globals.checkPoint.z = posZ;
			staminaBar.onCheckpiont = 7;
		}
	}

	void OnTriggerExit (Collider coll){
		staminaBar.onCheckpiont = 0;
	}
	
	// Update is called once per frame
	void Update () {
	}

}
