using UnityEngine;
using System.Collections;

public class GarbageCanScript : MonoBehaviour {


	private bool canThrowAwayGarbage = true;

	// Use this for initialization
	void Start () {
	
	}
	
	// Update is called once per frame
	void Update () {
	
		if(gameObject.animation.isPlaying){

			canThrowAwayGarbage = true;

		}

	}

	public void throwAwayGarbage(){

		if(canThrowAwayGarbage){

			audio.Play ();

			gameObject.animation.Play();
			canThrowAwayGarbage = false;

		}

	}

	public bool canInteract(){

		return canThrowAwayGarbage;

	}

}
