using UnityEngine;
using System.Collections;

public class SinkRepair : MonoBehaviour {

	public int cost;
	public int costIncrease;
	public AudioClip repair;
	
	private States states;
	
	// Use this for initialization
	void Start ()
	{
		states = GameObject.Find ("Player").GetComponent<States>();
	}
	
	void Update ()
	{
		GetComponent<InteractText>().interactText = "Repair sink : $" + cost;
	}
	
	void Use ()
	{
		if (states.playerMoney >= cost)
		{
			states.playerMoney -= cost;
			states.dailyWater++;
			cost *= costIncrease;
			AudioSource.PlayClipAtPoint(repair, transform.position);
		}
	}
}
