Esempio n. 1
0
 private void FixedUpdate()
 {
     if (tree != null)
     {
         healthText.text = "Tree Health: " + tree.GetHealth();
     }
 }
Esempio n. 2
0
 private void OnTriggerEnter(Collider collision)
 {
     if (collision.tag == "Tree")
     {
         tree = collision.GetComponent <TreeHealth>();
         healthText.enabled = true;
         healthText.text    = "Tree Health: " + tree.GetHealth();
     }
 }