// Use this for initialization
    void Start()
    {
        Text myText = GetComponent <Text> ();

        myText.text = Scorekeeper.score.ToString();
        Scorekeeper.Reset();
    }
    void OnTriggerEnter2D(Collider2D col)
    {
        Laser missile = col.GetComponent <Laser>();

        if (missile && col.name == "Enemy Laser Shot")
        {
            health -= missile.GetDamage();
            missile.Hit();
            if (health <= 0)
            {
                Scorekeeper.Reset();
                Destroy(gameObject);
            }
        }
    }
Esempio n. 3
0
 // Use this for initialization
 void Start()
 {
     text      = GetComponent <Text> ();
     text.text = Scorekeeper.totalPoints.ToString();
     Scorekeeper.Reset();
 }