Exemplo n.º 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;
        }
    }
Exemplo n.º 2
0
 public void Die()
 {
     OnBallDeath?.Invoke(this);
     Destroy(gameObject, 1);
 }
Exemplo n.º 3
0
 public void Die()
 {
     OnBallDeath?.Invoke(this);
     Destroy(gameObject, 1); // 1 is the One Second Delay
 }