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

        myText.text = Scorekeeper.score.ToString();
        Scorekeeper.Reset();
    }
Пример #2
0
    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);
            }
        }
    }
Пример #3
0
 // Use this for initialization
 void Start()
 {
     text      = GetComponent <Text> ();
     text.text = Scorekeeper.totalPoints.ToString();
     Scorekeeper.Reset();
 }