示例#1
0
    // if collided with the bullet or the player shipo then get destroyed
    private void OnTriggerEnter2D(Collider2D other)
    {
        switch (other.tag)
        {
        case ("Bullet"):
            _uiManager.AddScore();
            Destroy(other.gameObject);
            StartCoroutine(EmenyDeathSequence());
            break;

        case ("Player"):
            _playerShip.Damage();
            StartCoroutine(EmenyDeathSequence());
            break;

        default:
            break;
        }
    }