void Score() { uint score; score = ScoreCounte.CurrentScore(); scoreText.GetComponent <Text> ().text = "= " + score.ToString(); }
// Update is called once per frame void Update() { if (Input.GetMouseButtonDown(0)) { ScoreCounte.Rest(); SceneManager.LoadScene("TitleGame"); } }
void OnTriggerEnter(Collider c) { GameObject target = c.gameObject; if (target.GetComponent <House> () != null) { inHouse = true; } if (target.tag == "Buyer") { if (cropYields == 0) { target.GetComponent <Buyer> ().RingNoMoney(); return; } ScoreCounte.AddScore((uint)cropYields); cropYields = 0; target.GetComponent <Buyer> ().RingMoney(); Destroy(target); } }
// Use this for initialization void Start() { text = GetComponent <Text>(); text.text = ScoreCounte.CurrentScore().ToString(); }