title: Unity3D C# Inheritance Issue
body: <p>I have two c# scripts.<br>
  One for the cannon:  </p>
  
  <pre><code>using UnityEngine;
  using System.Collections;
  
  public class CannonScript : MonoBehaviour {
  
      public GameObject bullet; //bullet object
      public Transform spawnpoint; //spawn point
      float bulletspeed=-3000f; //bullet speed
      public int bullets=10; //number of bullets
  
      void Update () {
          if ((Input.GetKeyDown ("space") || Input.GetMouseButtonDown(0)) &amp;&amp; bullets &gt; 0) {
              GameObject newbullet; //make a new bullet
              newbullet=Instantiate(bullet,spawnpoint.position, spawnpoint.rotation)as GameObject; //instantiate the new bullet
              newbullet.rigidbody.AddForce(spawnpoint.forward * bulletspeed); //add force to the new bullet
              bullets--; //decrease the number of bullets left
          }
      }
  }
  </code></pre>
  
  <p>Another for the UI text on the screen:  </p>
  
  <pre><code>using UnityEngine;
  using UnityEngine.UI;
  using System.Collections;
  
  public class BulletCountScript : CannonScript { //inherit from the CannonScript
  
      Text text;
  
      void Start () {
          text = GetComponent&lt;Text&gt; ();
      }
  
      void Update () {
          text.text = bullets.ToString(); //display the number of bullets
      }
  }
  </code></pre>
  
  <p>When I run it, the UI text on the screen never changes.<br>
  I know the CannonScript is working properly, because I can only shoot 10 bullets.<br>
  How can I make my UI text display the amount of bullets left?<br>
  Am I doing something wrong with inheritance?</p>