Beispiel #1
0
    void OnTriggerEnter2D(Collider2D colider)
    {
        if (colider.tag == "Asteroid")
        {
            colider.SendMessage("NextStage");
            _spawner.SendMessage("SetNewScore");
            Destroy(this.gameObject);
        }

        if (colider.tag == "Alien")
        {
            _spawner.SendMessage("SetNewScore");
            Destroy(colider.gameObject);
            Destroy(this.gameObject);
        }
    }
Beispiel #2
0
    void OnTriggerEnter2D(Collider2D colider)
    {
        if (colider.tag == "Asteroid")
        {
            _spawner.SendMessage("Death");
            Destroy(colider.gameObject);
            Destroy(this.gameObject);
        }

        if (colider.tag == "Alien")
        {
            _spawner.SendMessage("Death");
            Destroy(colider.gameObject);
            Destroy(this.gameObject);
        }
    }