Exemplo n.º 1
0
    //check for lase collission (Trigger)
    //insraniate explosion at the position of the astroid (us)
    //destroy the explosion after 3 sec

    private void OnTriggerEnter2D(Collider2D other)
    {
        if (other.tag == "Laser")
        {
            if (_explosionPrefab != null)
            {
                Instantiate(_explosionPrefab, transform.position, Quaternion.identity);
                Destroy(other.gameObject);
                _spawnMamger.StartSpawning();
                Destroy(this.gameObject, 0.25f);
            }
        }
    }