using UnityEngine;
using UnityEngine.UI;
using System.Collections;

public class Gather : MonoBehaviour {

	// Use this for initialization
	void Start () {
		//print("start " + gameObject.name);
	}
	// Update is called once per frame
	void Update () {
	//	print("update " + gameObject.name);
	}

	void OnMouseDown() {
			//Application.LoadLevel("SomeLevel");
		print("clicked");

		int count = GameObject.Find("Quote").GetComponent <Quoter>().count;
//		GameObject.Find("ScoreGUIText").GetComponent <Scorer>().score++;
		GameObject.Find ("ScoreGUIText").GetComponent <Scorer> ().ShouldUpdateScore();

		//double value = Random.value * 1000;
		//value = value + GameObject.Find("ScoreGUIText").GetComponent <Scorer>().money;
		//GameObject.Find("ScoreGUIText").GetComponent <Scorer>().money = value;
		//print("value: " + value);

		//GameObject.Find("ScoreGUIText").GetComponent <Scorer>().score = Random.Range(1,7) + GameObject.Find("ScoreGUIText").GetComponent <Scorer>().score;

		// test 
		print ("resource count: " + GameObject.Find("Quote").GetComponent <Quoter> ().count);

		GameObject.Find("Quote").GetComponent <Quoter> ().ShouldUpdateQuote();


		print ("score: " + count);
		GameObject.Find("TAbs1").GetComponent <Spinner>().MoveUp(count);
		GameObject.Find("TAbs2").GetComponent <Spinner2>().MoveUp(count);


		//GameObject scriptGameObj = GameObject.Find("Scorer");
		//scriptGameObj
//		Script scoreScript = scriptGameObj.GetComponent(Scorer).
		gameObject.SetActive(false);
	}
}

