Exemple #1
0
    private void OnTriggerEnter2D(Collider2D collision)
    {
        if (collision.gameObject.tag == "Bottom")
        {
            OnBallDeath?.Invoke();

            // restick to player paddle
            rb.velocity        = Vector2.zero;
            transform.position = new Vector3(player.transform.position.x, -3.6f, 0);
            transform.parent   = player.transform;
        }
    }
Exemple #2
0
 public void Die()
 {
     OnBallDeath?.Invoke(this);
     Destroy(gameObject, 1);
 }
Exemple #3
0
 public void Die()
 {
     OnBallDeath?.Invoke(this);
     Destroy(gameObject, 1); // 1 is the One Second Delay
 }